public bool IsAdministrator() { WindowsIdentity current = WindowsIdentity.GetCurrent(); WindowsPrincipal windowsPrincipal = new WindowsPrincipal(current); return windowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator); }
转载声明:本文转载至http://www.zhoumy.cn/?p=9
时间: 2024-10-23 08:59:52