Results 1 to 8 of 8

Thread: [RESOLVED] Check if Network computer is on

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    47

    Resolved [RESOLVED] Check if Network computer is on

    I need a way of checking if a computer on the network is on

    Is there a ping command or something in vb that can do this?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Check if Network computer is on

    There's a ping command, but it's a Windows exe file, not a VB command.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    Re: Check if Network computer is on

    what version of VB?
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    47

    Re: Check if Network computer is on

    VB 6

    The problem I'm having is that my program uses some api functions to get information from all the machines on a network. It works ok but when it hits a computer that's turned off, the program seizes up.

    So I need a way of checking if the computer is on beforehand in vb. It doesn't necessarily have to be a ping. Any function that accesses a remote computer and fails immediately if the remote computer is switched off will do.

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Check if Network computer is on

    Since networks have delays, functions that access computers on networks are written with timeout delays. If they weren't, half the calls (or more) would fail on computers that were on.

    See if your program really freezes, or if it just waits for 60 or 120 seconds for a response.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    47

    Re: Check if Network computer is on

    Yes your right, it does have a timeout but it takes absolutely ages.

    I've been searching through some other functions to find something with a quicker timeout.

    Best so far is:
    NetWkstaGetInfo - 5 secs

  7. #7

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    47

    Re: Check if Network computer is on

    The problem is when you've got like 250 computers to go through and a lot are off, it is one heck of a delay.

    I found another function called IsDestinationReachable which I though I could use to determine if the remote comp was on before using my other net functions. But the problem is there is still a network connection to the computer even when it is switched off (led's on ethernet still on) so the function always returns true.

    This is really starting to annoy me and i desperately need a way around my situation, big plea for help to anyone with answers.

  8. #8
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    Re: Check if Network computer is on

    hmm...

    VB6 Ping (you can adjust the timeout interval labeld 'PING_TIMEOUT')
    http://vbnet.mvps.org/index.html?cod...net/index.html
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

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