|
-
Nov 11th, 1999, 05:10 PM
#1
Thread Starter
Junior Member
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.
-
Nov 12th, 1999, 09:22 AM
#2
Junior Member
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.
-
Nov 14th, 1999, 03:38 PM
#3
Thread Starter
Junior Member
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.
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
|