I'm not sure if I can get away with just checking the username - have to ask the client..... But I ended up installing 2005 version anyway =)
is returning False. But when I go to Control Panel, User Accounts, My account type is Computer Administrator - I thought it would show False for Limited or Guest Accounts and True for Computer Administrator ?Code:MessageBox.Show(My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator.ToString))
Update:t - I change my code to
and it now says I am an administrator. I must be missing somethingCode:If My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) Then Debug.WriteLine("User is an Administrator") Else Debug.WriteLine("User is not an Administrator") End IfFor some reason, using the "toString" causes it to return a false???




For some reason, using the "toString" causes it to return a false???
Reply With Quote