0
我寫了下面的代碼給讀取權限的組,但我得到anerror:如何給讀/寫權限的文件夾爲一組
"The trust relationship between the primary domain and the trusted domain failed."
如果我給一個用戶名,而不是它正在工作。
DirectoryInfo myDirectoryInfo = new DirectoryInfo(path);
DirectorySecurity myDirectorySecurity = myDirectoryInfo.GetAccessControl();
string group = "groupName";
myDirectorySecurity.AddAccessRule(new FileSystemAccessRule(group,FileSystemRights.Read, AccessControlType.Deny));
myDirectoryInfo.SetAccessControl(myDirectorySecurity);
IdentityReference參數還被定義爲鏈接到用戶帳戶,而不是組。你確定它可以很好地分配組權限嗎? – 2010-08-20 14:47:47