How would I go about doing a ping?(trying to keep alive old netspace). A simple list of APIs to call, and the order to call them in should do.
Posted on 2001-12-05 21:01:34 by peterverstappen
Some kid was begging for this recently and hiro (if I'm not mistake) closed the thread and put an end to the topic.

That said, I don't know how to do this programmatically(sp?) but if you just want to accomplish the ping and aren't concerned with doing it all yourself you can shell to dos, do your ping and grab the output (if needed.....either by getting it directly--if it's possible--or by piping it to a text file and then reading it in). I know it's dirty, but if it gets the job done, and you aren't worried about it, it'll work.

....maybe creating a 'ping.bat' and calling it from time to time?

Btw is there a way to close a dos box automatically (from the batch file) after a batch file is finished?
Posted on 2001-12-05 22:06:10 by Will
Check out the IcmpSendEcho API on MSDN. It's exactly what you're looking for. Also look at the IcmpCreateFile API, you'll need to call that first.

Edit: These API's are in ICMP.dll, I believe this is a standard Windows DLL. I'm not sure though.
Posted on 2001-12-06 01:55:35 by Qweerdy
If you have MSDN, there's an example using "semi-raw" sockets
(will work under NT *AND* 9x) that does ICMP PING, so you don't
have to use icmp.dll.
Posted on 2001-12-06 10:42:32 by f0dder
Well, the Icmp.dll way looked much easier, so I went along and made this program which shows just how easy it is :)

(In RadASM project format)
Posted on 2001-12-06 12:55:52 by Qweerdy
Thanks all! And especially Queerdy, it works a treat.
Posted on 2001-12-06 16:24:45 by peterverstappen
Read article Q170591 from MSDN

Sami
Posted on 2001-12-07 08:58:44 by SamiP