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