AppDomain domain = System.Threading.Thread.GetDomain();//获取当前域 domain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy.WindowsPrincipal); System.Security.Principal.WindowsPrincipal principal = (System.Security.Principal.WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; if (principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.User))//判断是否为普通用户 { string s = "您的电脑系统权限为:普通用户"; label6.Text = s; } if (principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.PowerUser))//判断是否为超级用户 { string s = "您的电脑系统权限为:超级用户"; label6.Text = s; } if (principal.IsInRole(System.Security.Principal.WindowsBuiltInRole.Administrator))//判断是否为系统管理员 { string s = "您的电脑系统权限为:系统管理员"; label6.Text = s; }