验证管理员权限(C#)

2017-01-04 12:08:17来源:cnblogs.com作者:yunsibuzhidao人点击

第七城市
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal;WindowsIdentity identity = (WindowsIdentity)principal.Identity;FastPrincipal prin = new FastPrincipal(identity);	isAdmin = prin.IsInRole(WindowsBuiltInRole.Administrator);
第七城市

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台