从对象中删除只读属性 [英] remove read only property from an object

查看:100
本文介绍了从对象中删除只读属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何删除对象属性的仅就绪属性?

How do you remove a ready only property of an object''s property?

推荐答案

我的猜测是对象"下的意思是文件(请参阅我对这个问题的评论).

您可以使用System.IO.File.GetAttributes,请参见:
http://msdn.microsoft.com/en-us/library/system. io.file.getattributes.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.io. fileattributes.aspx [ ^ ].

现在,请记住,最近这些天不经常使用文件属性,并且这不能保护文件系统免遭未经授权的使用.诸如NTFS的文件系统使用基于用户帐户和组的安全属性.特权不足的用户无论使用何种应用程序都无法克服这种保护.

如果您需要其他东西,请不要怪我-问题必须更加清楚.该答案基于一些猜测.

—SA
My guess is that under "object" you mean file (please see my comment to the question).

You can use System.IO.File.GetAttributes, see:
http://msdn.microsoft.com/en-us/library/system.io.file.getattributes.aspx[^],
http://msdn.microsoft.com/en-us/library/system.io.fileattributes.aspx[^].

Now, bear in mind that file attributes are not use often these days and this is not what provides protection of the file system from unauthorized use. File systems like NTFS uses security attributes based on user accounts and groups. A user having insufficient privileges cannot overcome such protection no matter what application she or he uses.

I you needed something else, please don''t blame me — the question have to be much more clear. This answer is based on some guesswork.

—SA


这篇关于从对象中删除只读属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆