C#判断程序是否是管理员权限运行的方法代码示例
程序员文章站
2023-11-29 17:20:28
public bool isadministrator()
{
windowsidentity current = windowsidentity.getcu...
public bool isadministrator() { windowsidentity current = windowsidentity.getcurrent(); windowsprincipal windowsprincipal = new windowsprincipal(current); return windowsprincipal.isinrole(windowsbuiltinrole.administrator); }