C#:判断当前程序是否通过管理员运行public bool IsAdministrator(){WindowsIdentity current = WindowsIdentity.GetCurrent();WindowsPRincipal windowsPrincipal = new WindowsPrincipal(current);return windowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator);}
转载声明:本文转载至http://www.zhoumy.cn/?id=4