0
Hy, sd 카드에 저장된 폴더에 대한 액세스를 제한 할 수있는 posibillities가 있습니까? 시도했지만 작동하지 않습니다 ... 어떤 아이디어를 환영합니다. 감사합니다 ...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