hi,
Wheather it is possible to get the users logged in winnt environment?
thanks in advance
minnal
Printable View
hi,
Wheather it is possible to get the users logged in winnt environment?
thanks in advance
minnal
No Problem.
Create a new standard project
Place 1 Command button on the form
Paste in the following code, into the forms code section.
Private Declare Function WNetGetUserA Lib "mpr" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long
Private Function GetUserName() As String
Dim sUserNameBuff As String * 255
sUserNameBuff = Space(255)
Call WNetGetUserA(vbNullString, sUserNameBuff, 255&)
GetUserName = Left$(sUserNameBuff, InStr(sUserNameBuff, vbNullChar) - 1)
End Function
Private Sub Command1_Click()
Me.Caption = GetUserName
End Sub
Hope this helps,
Steve.
Hi Steve
Thankx for ur immediate response its working perfect.
But is there any API for getting all the users logged in the network .
i need to add all the users logged in the nT network into a combo or list box.
please reply
bye
Minnal
Hi Steve
Thankx for ur immediate response its working perfect.
But is there any API for getting all the users logged in the network .
i need to add all the users logged in the nT network into a combo or list box.
please reply
bye
Minnal