Ping and Open Port

larnauth

New member
Joined
Dec 6, 2003
Messages
1
Hello all,

How do i check if a server is alive (ping response is acceptable) and if a service is running (an open port - 21 ftp, 1433 mssql, etc its also ok).

Can i do this in VB.NET or C# ?

Thank you,

Luis Arnauth
 
For the ping, youd need to lookup the specs for that. Im sorry I cant help you there. Try looking for RFC and ICMP echo in google. I know people have created a published programs that can ping in .net.

For detecting a service though, the easiest way would probably be to create a TcpClient and connect to the IP and the port of the service. If an exception is thrown, the service probably doesnt exist on the specified IP.
 
Back
Top