Results 1 to 12 of 12

Thread: How to see if a user is logged in to the network using API

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    9

    Question How to see if a user is logged in to the network using API

    I got to make a program that checks if the user is loggin on the network.
    How do you do that?

    if user is loggin in the true
    else false.

    If you know can you also make sample code for me to learn off of?

    -Scave

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    9
    Wow..
    that is alot of code..
    All i was really looking for was like:

    dim strName as string

    strName = bob

    userloggin(fake function) = strName
    if userloggin = false then "error"
    else "ok"

    I will try to decode your code to make it seem like that.
    Thx

  3. #3
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking

    Here's a lovely little bit of code which I got off the internet:

    However, I do have a program, which lists ALL users on the network in a treeview and allows you to send message to them.
    I think it may be too large to post it on this site but I'll try.

    Hack: The code, which you posted a link for, is weird. I can't get it to work. Very strange code

    The form below is almost as weird, but works...to find out for 1 user just change the line:
    VB Code:
    1. Call GetUserInfo(Users(x), UserName, Logged)
    To
    VB Code:
    1. Call GetUserInfo("Steveb", UserName, Logged)

    Well, you have to change Steveb to the NT username you want to look for. errr, I'll try and post my NT messenger code, which also lists the PC's people are logged into. I wrote it for use with soem spy ware so our help desk department could see what was going happening on a users machine when they had problems. Here you go...
    Attached Files Attached Files

  4. #4
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking Rough around the edges?! It's supposed to be like that!

    Here's the NT VNC application i was on about.

    It's not finished yet, so I appologies if some of my code is not consistant. I just put it in there for speed....if you want the full version then send me a message and I will post it to you when it's finished...

    I know it's not exactally what you were looking for, but I will post THAT code in a second. Just others may be interested in this
    Attached Files Attached Files

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    9
    It didn't work how i think it should have worked...
    Right now there is 4 ppl on the network.
    And i changed the users(x) to one of the computer names
    and the out put i got was:

    user:admin,, Login status =
    user:guest,, Login status =
    user:training-3,, Login status =

    and that is it... That is me!

    I am also making a msger but if the to user is off the network it still sends it with out an error msg.
    So I want to send it only if the to user is on the network.

    But thx any ways...

  6. #6
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking hahaha...Car keys for Mobile, good swap...

    Here's the code to check if a user is logged on.

    All you do is ebter the server name and the NT username and click the button, simple eh?

    One problem, if the user hasn't accessed the server for say 20 minutes, don't know the exact time, they are deemed to have logged off.

    There is another API command around this as the one I have used gets PC names as well...
    Attached Files Attached Files

  7. #7
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking Woof, Bark, Growl...My hamster has a serious problem!

    i have written a great messenger program, different to the VNC program which I posted above...I'll see if it's small enough to post here

    Here it is:

    You type the message in then click on the buttons on the graphic(bottom right) they have tooltips. Click on the button with the tooltip "Select Users" then right click in the blue part and add a user....

    It stores the names, hides itself off screen and sends to multiple users and tell you if they received the message...

    What do you think of it...?

    Code maybe a bit crap, but I wrote it after knowing Vb for 3 months
    Attached Files Attached Files

  8. #8

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    9
    Ok, thx! I think this will do it good
    I have to get my boss to look at it.
    When I am done.
    thx

  9. #9

  10. #10

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    9
    I just made it up.

  11. #11
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking Hmmmm...very tired of the internet...

    Hope it goes well...
    Give us a shout if you need any help.

    I know it's API code, but if you put another post, like this, in the GENERAL VB QUESTIONS forums then loads more people will look at it

    Not many people read the API section, well compared to the general section anyways

  12. #12

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Posts
    9
    ok, thx

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