VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



gives the username of your system

by Vineeth Venugopal (7 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 9th June 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

gives the username of your system

API Declarations





Rate gives the username of your system




Private Sub Command1_Click()
   Call User_Name
End Sub

Private Function User_Name() As String
   Dim nName As String 'name of the logged user
   Dim nBuffer As String
   Dim nSize As Long
   nBuffer = Space$(250)
   nSize = Len(nBuffer)
   If GetUserName(nBuffer, nSize) = 1 Then
      nName = Trim(nBuffer)
      MsgBox nName
      Exit Function
   End If
End Function




Download this snippet    Add to My Saved Code

gives the username of your system Comments

No comments have been posted about gives the username of your system. Why not be the first to post a comment about gives the username of your system.

Post your comment

Subject:
Message:
0/1000 characters