示例#1
0
 /// <summary>Initializes a new instance of the <see cref="SystemSecurity"/> class.</summary>
 /// <param name="access">The access rights mask for the actions to be taken.</param>
 /// <param name="server">The server. Use <c>null</c> for the local server.</param>
 public SystemSecurity(DesiredAccess access = DesiredAccess.AllAccess, string server = null)
 {
     Handle = LsaOpenPolicy((LsaPolicyRights)(ACCESS_MASK.STANDARD_RIGHTS_REQUIRED | (uint)access), server);
     svr    = server;
     CurrentUserLogonRights = new LogonRights(this);
     CurrentUserPrivileges  = new AccountPrivileges(this);
 }
 /// <summary>Initializes a new instance of the <see cref="LocalSecurityAuthority"/> class.</summary>
 /// <param name="server">The server. Use <c>null</c> for the local server.</param>
 /// <param name="access">The access rights mask for the actions to be taken.</param>
 public LocalSecurityAuthority(string server = null, DesiredAccess access = DesiredAccess.AllAccess)
 {
     handle = LsaOpenPolicy(server, (LsaPolicyRights)((uint)AccessTypes.STANDARD_RIGHTS_REQUIRED | (uint)access));
     svr    = server;
     CurrentUserLogonRights = new LogonRights(this);
     CurrentUserPrivileges  = new AccountPrivileges(this);
 }