Results 1 to 3 of 3

Thread: How to know the current user

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Quito, Pichincha, Ecuador
    Posts
    9
    Hello,

    Could anyone tell me how to get the current user that is running on NT?

    Thanks.

    Marco

  2. #2
    Junior Member
    Join Date
    Jun 1999
    Location
    St. Louis MO USA
    Posts
    18
    In VB it tis something like this...
    Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal _
    lpbuffer As String, nsize As Long) As Long

    Sub Get_User_Name()

    Dim lpBuff As String * 25
    Dim ret As Long
    Dim UserName As String

    ret = GetUserName(lpBuff, 25)
    UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
    'MsgBox UserName
    UserName1 = UserName

    End Sub

    Hope it Helped

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Quito, Pichincha, Ecuador
    Posts
    9
    Thanks Raicheman, it worked like a dream, but can I use this function in Windows 95/98/2000 too?


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