![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hey I'am writing a Windows application using C#. I would like to do this: Application Start: Is User Authendicated (windows) does user exists in Administrators or in MyAppGroup ( MyAppGroup = the AD group for users running the application) If IsUser Authendicated = False or not in the above groups -> display login form I found some code: System.Security.Principal.WindowsIdentity ident = System.Security.Principal.WindowsIdentity.GetCurre nt(); System.Security.Principal.WindowsPrincipal prin = new WindowsPrincipal(ident); System.Threading.Thread.CurrentPrincipal = prin; IdentityReferenceCollection col = ident.Groups; IdentityReference ir = col[1]; In the ident object i'll get the IsAuthendicated property and also i see the Groups property The two last lines was just to have a look on a group. I cant get the group name (like Administrator) how to do that? Kind regards Johnny E. Jensen |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |