U know in Win 98 that you can have that login box so that you can have different users for the pc, well my question is how to get the current user of the pc ?
Printable View
U know in Win 98 that you can have that login box so that you can have different users for the pc, well my question is how to get the current user of the pc ?
Code:Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function CurrentUser() As String
Dim temp As String * 255
GetUserName temp, 255
CurrentUser = Left$(temp, InStr(temp, vbNullChar) - 1)
End Function
Cheers. Just what i wanted !