VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Function that returns Network Username from any workstation connected to the network.

by Issa Fahmy (7 Submissions)
Category: Windows System Services
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Wed 15th August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Function that returns Network Username from any workstation connected to the network.

API Declarations


(ByVal lpbuffer As String, nSize As Long) As Long

Rate Function that returns Network Username from any workstation connected to the network.



  Dim lngNUserSize As Long
  Dim strNetUserName As String
  
  'get the user name
  lngNUserSize = 255
  strNetUserName = Space(lngNUserSize)
  If GetUserName(strNetUserName, lngNUserSize) <> 0 Then
    strNetUserName = Left$(strNetUserName, lngNUserSize - 1)
  Else
    strNetUserName = "DEFAULT"
  End If
  GetNetworkUser = UCase(strNetUserName)
  
End Function


Download this snippet    Add to My Saved Code

Function that returns Network Username from any workstation connected to the network. Comments

No comments have been posted about Function that returns Network Username from any workstation connected to the network.. Why not be the first to post a comment about Function that returns Network Username from any workstation connected to the network..

Post your comment

Subject:
Message:
0/1000 characters