Today, I am going to share something useful. In this tutorial we will learn how to ping an IP address or a host using ASP.NET.

Ping from ASP.NET

Directly moving to a design. Below is the simplest possible design for Ping. We have used a textbox, a button and a textarea. PingDesign

Code for ASPX Page.

Now, just add below line of code on button click event. But before that, ensure to add a namespace which is mentioned below.

Ok, Now lets Run page and see the outcome by putting a hostname or IP address.

We have successfully received reply using ping from If you want to know more about Pinging in C#, you can learn a lot from below article published at CodeProject.
Thanks for reading. If you like this article and find helpful anyway, you can help use by sharing on social networks or leaving comments with suggestions or feedback.
John Bhatt

Facebook Comments