if ()
{
ExtNet.Msg.Show(new MessageBoxConfig
{
Title = "错误",
Icon = MessageBox.Icon.ERROR,
Buttons = MessageBox.Button.OK,
Message = "无修改权限"
});
return;
}
System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent();
System.Security.Principal.WindowsPrincipal principal = new System.Security.Principal.WindowsPrincipal(identity);
//判断当前登录用户是否为管理员
if (!principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator))
{
return false;//不是管理员
}
这个要看你前面怎么写的。你这样提问很奇怪,难道你根本不会写程序?
Membership.GetAllUsers()用这个来读取所有用户,,然后判断
你的意思是想判断是不是管理员吧?
感觉你的问题有歧义 表述不清晰