Function that returns Network Username from any workstation connected to the network.
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.
(2(2 Vote))
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
Function that returns Network Username from any workstation connected to the network. Comments
No comments yet — be the first to post one!
Post a Comment