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.
问题很简单,但我还没有找到解决方案。我想在 NTFS 卷上创建目录并将其属性设置为加密 (EFS)。File.SetAttributes()不适用于目录。
File.SetAttributes()
使用 FileInfo 对象的 Encrypt 和 Decrypt 方法:
FileInfo fInfo = new FileInfo(FileName); // Add encryption. fInfo.Encrypt();