|
-
Nov 10th, 1999, 02:22 PM
#1
Thread Starter
Junior Member
hi,
Wheather it is possible to get the users logged in winnt environment?
thanks in advance
minnal
-
Nov 10th, 1999, 02:51 PM
#2
Lively Member
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.
-
Nov 10th, 1999, 04:14 PM
#3
Thread Starter
Junior Member
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
-
Nov 10th, 1999, 04:55 PM
#4
Thread Starter
Junior Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|