通过dInfo=DirectoryInfo(filepath)获取文件夹的访问权限,
DirectorySecurity dSecurity = dInfo.GetAccessControl(System.Security.AccessControl.AccessControlSections.All);
System.Security.Principal.IdentityReference identityReference;
identityReference = dSecurity.GetGroup(typeof(System.Security.Principal.NTAccount));

本地运行没有问题的,但是部署到IIS上面,别的机器通过web访问的时候,就出现了错误:
[PrivilegeNotHeldException: 该进程不具有执行此操作所需的“SeSecurityPrivilege”特权。]
   System.Security.AccessControl.Win32.GetSecurityInfo(ResourceType resourceType, String name, SafeHandle handle, AccessControlSections accessControlSections, RawSecurityDescriptor& resultSd) +697
   System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext) +63
   System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory) +86
   System.Security.AccessControl.DirectorySecurity..ctor(String name, AccessControlSections includeSections) +45
   System.IO.DirectoryInfo.GetAccessControl(AccessControlSections includeSections) +29
   DocmManagem.DocuMN.Databind(String pathurl) in C:\Inetpub\wwwroot\123\DocmManagem\DocmManagem\DocuMN.aspx.cs:404
   DocmManagem.DocuMN.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\123\DocmManagem\DocmManagem\DocuMN.aspx.cs:99
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
真心希望各位朋友能够指点迷津。帮小弟一个忙,非常感谢!