public bool IsAdministrator()
{
    WindowsIdentity current = WindowsIdentity.GetCurrent();
    WindowsPrincipal windowsPrincipal = new WindowsPrincipal(current);
    return windowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator);
}

  

posted on 2015-11-12 13:33  广  阅读(625)  评论(0)    收藏  举报