C#里判断当前进程/线程是否运行在管理员身份下
WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); bool isRunningElevated = principal.IsInRole(WindowsBuiltInRole.Administrator);
C#里判断当前进程/线程是否运行在管理员身份下
WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); bool isRunningElevated = principal.IsInRole(WindowsBuiltInRole.Administrator);
Leave a Reply
You must be logged in to post a comment.