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?
Printable View
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?
There's a ping command, but it's a Windows exe file, not a VB command.
what version of VB?
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.
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.
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
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.
hmm...
VB6 Ping (you can adjust the timeout interval labeld 'PING_TIMEOUT')
http://vbnet.mvps.org/index.html?cod...net/index.html