|
-
Mar 20th, 2000, 01:40 AM
#1
Thread Starter
New Member
Hello,
Could anyone tell me how to get the current user that is running on NT?
Thanks.
Marco
-
Mar 20th, 2000, 03:45 AM
#2
Junior Member
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
-
Mar 20th, 2000, 04:11 AM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|