Results 1 to 3 of 3

Thread: Environment ID equivalent in VB6

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    91

    Question Environment ID equivalent in VB6

    Hey Peeps,

    Would anyone know the equivalent form vb.net to VB6.0 for grabbing the environment.UserName? The below is in vb.net but I need to do the same thing for VB6.0.

    messagebox.Show(environment.UserName)
    messagebox.Show(my.User.Name)


    Thanks,
    n3m.

  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Environment ID equivalent in VB6

    try,
    MsgBox Environ("USERNAME")

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Environment ID equivalent in VB6

    In VB6, I prefer using the GetUserName API
    Code:
    Private Declare Function GetUserName Lib "advapi32.dll" Alias _
    "GetUserNameA" _
    (ByVal lpBuffer As String, _
    nSize As Long) As Long

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