0
Hy, 是否有任何限制可以限制存儲在SD卡上的文件夾? 我試過這個,但它不工作...任何想法都歡迎。 謝謝...限制對存儲在SD卡上的文件夾(及其所有文件和子目錄)的訪問權限C#
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);
}
您可以嘗試加密文件和子目錄。 –
限制目錄權限示例:http://www.redmondpie.com/applying-permissions-on-any-windows-folder-using-c/ – Thinhbk