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.
Re: Environment ID equivalent in VB6
try,
MsgBox Environ("USERNAME")
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