Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ping server

Status
Not open for further replies.

meldrape

Programmer
May 12, 2001
516
0
16
US
Greetings!

It is possible to ping a server from a command button? Any thoughts would be greatly appreciated. Thanks.

 
Do you know how to use the shell api (if you don't Ill post it later)

Just execute "C:\windows\ping.exe" with the paramter of the ip address.

If you have it minimized or hidden the user won't ever see it, but I don't know how you will get data back.
Brad,
Hey! email me any time! Bradsvb@yahoo.com
 
Well ya need the SOCKETS API declarations and a significant investment in brain surgery...actually it is not that bad...I could send an example of an app I scraped off the net somewhere...if you don't mind posting your email address...bad netiquette, but hey...
 
Check the Tek Tips FAQ section first. faq222-607 has all the basics for pinging an address.
VCA.gif
 
Maybe another simple way, down and dirty:

In using the Shell API, you could execute the line

c:\WINNT\System32\ping.exe 127.0.0.1 >result.txt

This will send the ping results to a file instead of the dos screen. You could set up your progam to check the size of the file when the size is greater than 0. You can then get the data by parsing the file.

note:
to ping multiple ip's do the following

c:\WINNT\System32\ping.exe 127.0.0.1 >result.txt
c:\WINNT\System32\ping.exe 127.0.0.2 >>result.txt

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top