Results 1 to 3 of 3

Thread: Trying to get user info over NT

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Liskeard, cornwall
    Posts
    21

    Post


    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.

  2. #2
    Junior Member
    Join Date
    Nov 1999
    Posts
    27

    Post

    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.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Liskeard, cornwall
    Posts
    21

    Post

    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
  •  



Click Here to Expand Forum to Full Width