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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ping an IP Address

Status
Not open for further replies.

WoodyRoundUp

Programmer
Feb 28, 2001
187
AU
Hi guys. i just want to know is there any code that will allow me ping an ip address?
i need to do this because i wan to do a chat room. but, i think by pinging an ip add will not really do. so, is there any way to make sure that the user is still on the page?
thanks for help. :)
adios.
 
Sure:

If you are on a Windows server, just use the system command:

[tt]
system(ping ipaddress);
[/tt]

I am not sure how to do it on Linux though. It might use the same program, but I am not sure.

HTH.

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
i tried, but it requires the package header..what should i use as the package header?
thanks..
 
what would be the code for a command button named cmdPing to ping the IP address in text box 1 (txt1), and display results in text box 2 (txt2)???

can you help me please?
 
Dear Woody:

You should check out one of the many ping function implementations in C, C++ (object-oriented), Delphi and even Visual Basic. Just do a search and you'll find your code snippet.

Using the "system" command should be avoided. It makes your program inefficient and dependable on external programs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top