System.Security.Principal.WindowsIdentity ident =
System.Security.Principal.WindowsIdentity.GetCurrent();
System.Security.Principal.WindowsPrincipal prin =
new System.Security.Principal.WindowsPrincipal(ident);
System.Threading.Thread.CurrentPrincipal = prin;
if (prin.IsInRole(new System.Security.Principal.SecurityIdentifier("S-1-45-44-46456-44564-456456-232")))
{
//Code hier ausführen
}
|