|
-
July 5th, 2001, 03:37 AM
#1
How can I get the User Name and Password of Users from LAN?
I'd like to get the User Name and Password for Security purposes on my .mdb file. I need to validate if the User really exists.
-
July 9th, 2001, 07:51 PM
#2
Re: How can I get the User Name and Password of Users from LAN?
I do not know how (or if you can) get the user's password, but you can use the GetUserName API to retrieve the network login ID. Put the following in a code module:
public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (byval lpBuffer as string, nSize as Long) as Long
public Function MyGetUserName() as string
Dim strUser as string
Dim lngTemp as Long
Dim lngResult as Long
lngTemp = 255
strUser = string(lngTemp, " ")
lngResult = GetUserName(strUser, lngTemp)
MyGetUserName = mid(strUser, 1, lngTemp - 1)
End Function
Then call the function like this:
UserName = MyGetUserName
Hope this helps,
Jason
-
August 4th, 2003, 12:35 AM
#3
how to have it in a loop?
Hi jn8230!
I found your code useful in getting the login name of PC in a LAN.
I made a list box and place your codes in a module. Then on form load, I placed the following codes:
Dim UserName As String
UserName = MyGetUserName
List1.AddItem UserName
how do I make this code loop so that I could get all the names of the PCs in our LAN? We have almost 80 PCs here.
I hope you can give some idea.
Thank you!!!
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
|