HY, 有没有可能限制访问存储在SD卡上的文件夹? 我尝试了这个,但它不起作用......任何想法都是受欢迎的。 感谢...
public static void setRight(string dirName,string account, FileSystemRights rights, AccessControlType controlType)
{
DirectoryInfo dir = new DirectoryInfo(dirName);
DirectorySecurity dSecurity = new DirectorySecurity();// Directory.GetAccessControl(dirName);
// Add the FileSystemAccessRule to the security settings.
dSecurity.AddAccessRule(new FileSystemAccessRule(account, rights, controlType));
// Set the new access settings.
dir.SetAccessControl(dSecurity);
Directory.SetAccessControl(dirName, dSecurity);
}