How to remove a single Attribute (e.g. ReadOnly) from a File?

前端 未结 7 1678
南方客
南方客 2020-11-28 08:54

Let say, a file has the following attributes: ReadOnly, Hidden, Archived, System. How can I remove only one Attribute? (for example ReadOnly)

相关标签:
7条回答
  • 2020-11-28 09:46

    Use this:

    private static FileAttributes RemoveAttribute(FileAttributes attributes, FileAttributes attributesToRemove)
    

    Read detail here in MSDN: http://msdn.microsoft.com/en-us/library/system.io.file.setattributes.aspx

    0 讨论(0)
提交回复
热议问题