need ping help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

need ping help

jWarrior
I am trying to write a small utility for the teachers at my kids
school to use to see what their network status is. I want to
1) ping 192.168.1.1
2) run ipconfig or winipcfg to see if I get a dynamic ip address
3) ask the network who is logged on

Anyway, I found the method ping: in WinInetLib and ran this
code:


lib := WinInetLibrary open.
lib ping: '127.0.0.1'. ---------> false

yet a DOS box 'ping 127.0.0.1' works fine.

What's going on here? And how do I do parts 2 and 3?

TIA.

Donald


Reply | Threaded
Open this post in threaded view
|

Re: need ping help

Blair McGlashan
Donald

You wrote in message news:94i3r2$j5u$[hidden email]...

> I am trying to write a small utility for the teachers at my kids
> school to use to see what their network status is. I want to
> 1) ping 192.168.1.1
> 2) run ipconfig or winipcfg to see if I get a dynamic ip address
> 3) ask the network who is logged on
>
> Anyway, I found the method ping: in WinInetLib and ran this
> code:
>
>
> lib := WinInetLibrary open.
> lib ping: '127.0.0.1'. ---------> false
>
> yet a DOS box 'ping 127.0.0.1' works fine.
>
> What's going on here?...

I think the #ping: method is slightly misnamed in that it does not perform
quite the same function as the "ping" command. The MS docs for the
underlying function say that it can be used to "ping a URL", and indeed if
you try an expression such as:
    lig ping: 'http://www.object-arts.com'
Then it does work. Basically it needs to be supplied with a URL, and not an
IP address.

I'm not sure that it is possible to use the WinInetLibrary library to
implement ping functionality quite so simply as with a single call. I would
try searching around at msdn.microsoft.com to see if you can find any
relevant samples.

>.. And how do I do parts 2 and 3?

Off the top of my head, I'm afraid I don't know, sorry.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: need ping help

Chris Double-2
"Blair McGlashan" <[hidden email]> writes:

> I'm not sure that it is possible to use the WinInetLibrary library to
> implement ping functionality quite so simply as with a single call. I would
> try searching around at msdn.microsoft.com to see if you can find any
> relevant samples.

See: http://www.cyberport.com/~tangent/programming/winsock/

This contains some information on how to 'ping'.

Chris.
--
http://www.double.co.nz/smalltalk