Check for the Admin User (C#) !!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Atran
    Contributor
    • May 2007
    • 319

    Check for the Admin User (C#) !!!

    Hello:
    I build my application, bu I want to the application know if the user is Adminstrator or not using C#.
    Thanks......... ............... ............... ......
  • chinu
    New Member
    • Jun 2007
    • 36

    #2
    Originally posted by Atran
    Hello:
    I build my application, bu I want to the application know if the user is Adminstrator or not using C#.
    Thanks......... ............... ............... ......
    try this
    WindowsPrincipa l pri = new WindowsPrincipa l(WindowsIdenti ty.GetCurrent() );
    bool b = pri.IsInRole("A dministrators") ;

    Comment

    • Atran
      Contributor
      • May 2007
      • 319

      #3
      Originally posted by chinu
      try this
      WindowsPrincipa l pri = new WindowsPrincipa l(WindowsIdenti ty.GetCurrent() );
      bool b = pri.IsInRole("A dministrators") ;
      Thanks chinu.......... .........

      Comment

      Working...