public bool IsAdministrator()
{
WindowsIdentity current = WindowsIdentity.GetCurrent();
WindowsPrincipal windowsPrincipal = new WindowsPrincipal(current);
return windowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator);
}
您可能感兴趣的文章:C#引用访问权限分析c#通过进程调用cmd判断登录用户权限代码分享C#枚举中