Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将文件设置为只读?
我正在使用带有 C# 的 WPF。
您可以使用 :
File.SetAttributes("pathToTheFile", FileAttributes.ReadOnly);
msdn 上的更多示例:
https://msdn.microsoft.com/en-us/library/system.io.file.setattributes(v=vs.110).aspx