日期:2014-05-18 浏览次数:20719 次
DirectoryInfo dirinfo = new DirectoryInfo(@"C:\Test"); System.Security.AccessControl.DirectorySecurity dirsecurity = dirinfo.GetAccessControl(); dirsecurity.AddAccessRule(new System.Security.AccessControl.FileSystemAccessRule("IIS_WPG", System.Security.AccessControl.FileSystemRights.FullControl, System.Security.AccessControl.InheritanceFlags.None, System.Security.AccessControl.PropagationFlags.None, System.Security.AccessControl.AccessControlType.Allow)); dirinfo.SetAccessControl(dirsecurity);