C#:判断当前程序是否通过管理员运行
2020-12-13 15:50
阅读:459
标签:style blog http color ar sp div log bs 转载声明:本文转载至http://www.zhoumy.cn/?p=9 C#:判断当前程序是否通过管理员运行 标签:style blog http color ar sp div log bs 原文地址:http://www.cnblogs.com/DoNetCoder/p/4081367.html
public bool IsAdministrator()
{
WindowsIdentity current = WindowsIdentity.GetCurrent();
WindowsPrincipal windowsPrincipal = new WindowsPrincipal(current);
return windowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator);
}
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:C#:判断当前程序是否通过管理员运行
文章链接:http://soscw.com/index.php/essay/35476.html
文章标题:C#:判断当前程序是否通过管理员运行
文章链接:http://soscw.com/index.php/essay/35476.html
评论
亲,登录后才可以留言!