using System;
using System.Security.Principal;
WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);
if (wp.IsInRole(WindowsBuiltInRole.Administrator))
{
//Console.WriteLine("Admin");
Console.WriteLine(WindowsBuiltInRole.Administrator.ToString());
}
No comments:
Post a Comment