As far as I remember the NetworkInformation.Ping class only supports ICMP.
If you want to do a tcp-ping, then you're probably better off looking at
System.Net.Sockets namespace.
http://msdn2.microsoft.com/library/1612451t(en-us,vs.80).aspx (I'm assuming
you're working with one of the CTP or Beta drops of 2.0)
Cathal
"Eric Wenger" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm pretty new to C# and I'm trying to do what I believe should be a
> simple thing. I want to modify a program that is using the
> System.Net.NetworkInformation.Ping class to have some custom behavior.
> For example I would like to do a "TCP-ping" where I try to connect to a
> TCP port on a remote machine. It seems obvious to me that I should try
> to derive a new Ping class (TCPPing) from the existing class so that I
> can use its interfaces.
>
> Unfortunately for me, the PingReply class (returned by Ping.Send())
> does not have a constructor and has no settable properties. It seems
> like I would have to go into "unsafe" code land to figure out what's
> inside but I can't do that either.
>
> Is there a solution to this or do I need to try a different approach?
>
|