Friday, June 26, 2009

C#: How to Ping a remote computer

Recently I was updating my free server monitoring software to include pre-checking of servers (if its online) before conducting resource information retrieval. To check if a server is indeed connected in the network, I included a Ping module that transmit a 32 bytes buffer to a remote computer (imitates windows ping command) and wait for reply.

.NET framework include a Ping class that allows an application to determine whether a remote computer is accessible over the network.