Judge whether the user is in some windows group.

it2022-05-09  16

1 using  System.Security.Principal; 2   3 public   static   bool  IsAdminRole() 4    {5   WindowsPrincipal myPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());  6   return myPrincipal.IsInRole(WindowsBuiltInRole.Administrator);7  }

转载于:https://www.cnblogs.com/skyfei/archive/2006/07/17/452867.html


最新回复(0)