|
Private Declare Function WNetGetUser Lib "mpr" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Create a buffer
Dim UserName As String * 255
'Get the network user
If WNetGetUser("", UserName, 255) = 0 Then
MsgBox Left$(UserName, InStr(UserName, Chr$(0)) - 1)
Else
MsgBox "Not logged on"
End If
End Sub
|
|