VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Display the name of the user currently logged on.

by Ayan Chaudhuri (8 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 2nd March 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Display the name of the user currently logged on.

Rate Display the name of the user currently logged on.



Dim slength As Long
Dim retval As Long

Private Sub Command1_Click()

username = Space(255)
slength = 255
retval = GetUserName(username, slength)  ' slength is now the length of the returned string
username = Left(username, slength - 1)  ' extract the returned info from the buffer

Text1 = "The name of the current user is " + username

End Sub


Download this snippet    Add to My Saved Code

Display the name of the user currently logged on. Comments

No comments have been posted about Display the name of the user currently logged on.. Why not be the first to post a comment about Display the name of the user currently logged on..

Post your comment

Subject:
Message:
0/1000 characters