Click to See Complete Forum and Search --> : Trying to get user info over NT
Milleniux
Nov 11th, 1999, 04:10 PM
I am still trying to get the user login of a particular computer from another computer. I want to be able to type in the Computer name (On the NT network) and then allow it to return the IP address (which I have worked out) and also the User login on that machine at that present time (which I need help with).
Please ... If anyone can help.
Cheers
M.
clefus
Nov 12th, 1999, 08:22 AM
Under Windows 95, the computer can be set up so that many different users can log into the computer. The name of current user can be retrieved by using the following code.
Dim s As String
Dim cnt As Long
Dim dl As Long
Dim CurUser as String
cnt = 199
s = String$(200, 0)
dl = GetUserName(s, cnt)
If dl <> 0 Then curuser = Left$(s, cnt) Else curuser = ""
You must declare the following function in the declarations section of a form or module in the project.
Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) _
As Long
Win95..Yes, but it should be the same idea.
Milleniux
Nov 14th, 1999, 02:38 PM
Cheers for that ... but once again this code only gives me the user logged onto the machine that I am running the code on. I want to be able to type in a computername and then allow it to return the user logged into that particular computer. (not the one I am actually using)....
any ideas?
M.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.