Results 1 to 19 of 19

Thread: [02/03] Determining XP Login Credentials within VB

Threaded View

  1. #14

    Thread Starter
    Lively Member
    Join Date
    Jun 2007
    Posts
    115

    Re: [02/03] Determining XP Login Credentials within VB

    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 =)

    Code:
    MessageBox.Show(My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator.ToString))
    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 ?

    Update:t - I change my code to

    Code:
     If My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) Then
                Debug.WriteLine("User is an Administrator")
            Else
                Debug.WriteLine("User is not an Administrator")
            End If
    and it now says I am an administrator. I must be missing something For some reason, using the "toString" causes it to return a false???
    Last edited by jeffnyc; Jul 15th, 2007 at 02:36 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width