Is the logged on user an administrator?
Visual Basic
2
Posts
2
Posters
0
Views
1
Watching
-
How do I check if the logged onm user is an administrator in VB.Net? '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
-
How do I check if the logged onm user is an administrator in VB.Net? '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
Try something like:
Imports System.Security.Principal
...
Dim identity As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim principal As New WindowsPrincipal(identity)
Dim isAdmin As Boolean = principal.IsInRole(WindowsBuiltInRole.Administrator)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer