Results 1 to 4 of 4

Thread: [RESOLVED] XP Log-in account

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2002
    Posts
    54

    Resolved [RESOLVED] XP Log-in account

    Can anyone help mefind the level of the person currently logged into the current windows instance via VB6 code please?
    I need to know if it's an admin level user or restricted user.

    Thank you.

  2. #2
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: XP Log-in account

    Try and use this

    VB Code:
    1. Private Declare Function IsNTAdmin _
    2.     Lib "advpack.dll" ( _
    3.         ByVal dwReserved As Long, _
    4.         ByRef lpdwReserved As Long) _
    5.         As Long
    6.  
    7.  
    8. Private Sub CommandButton1_Click()
    9.     Dim lngResult As Long
    10.    
    11.     Call IsNTAdmin(0, lngResult)
    12.    
    13.     Select Case lngResult
    14.         Case 0
    15.             MsgBox "Not an admin"
    16.         Case 1
    17.             MsgBox "You are an admin"
    18.     End Select
    19. End Sub

    perhaps something like that, i'm on a network at college at the moment so i do not have admin rights so i can't test to see if works properly.

    Hope this helps

    Jenova

  3. #3
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: XP Log-in account

    CS

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2002
    Posts
    54

    Re: XP Log-in account

    Thanks guys, problem solved.

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