Ping an IP address from ASP.NET


Hi,

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.
PingReply

We have successfully received reply using ping from asp.net. 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

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *