题
是否有某个库方法可以确定文件是否已使用EFS加密?我在FileInfo上看到 Encrypt()
和 Decrypt()
方法,但我正在寻找一种查询文件状态的方法。
解决方案
其他提示
扩展bdolan& matt的评论:
<snip>
using System.IO;
<snip>
FileInfo fi = new FileInfo(uri); //uri is the full path and file name
if (fi.Attributes.HasFlag(FileAttributes.Encrypted))
{
//FILE IS ENCRYPTED
}
else
{
//FILE IS SAFE
}
不隶属于 StackOverflow