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