• How to Ping a Server in ASP.NET

    by  • May 20, 2013 • Microsoft .NET C# (C-Sharp), Microsoft ASP.NET, Microsoft VB.NET • 0 Comments

    Your obvious choice is to check the server which you want to connect, is up and running. The following piece of code is a simple way to ping your desire server in your ASP.NET application. You can use it to check the server periodically and make your choice according to server status.

    Let’s see the code. You can also download the code at the bottom.

    C# Code to Ping Server

    VB.NET Code to Ping Server

    First we need to create a Ping class object and then we need to call send() method of Ping class providing our desired IP address and assign it to PingReply class object. Now we can get server information by using PingReply class object.

    Best WordPress Themes and Plugins with Great Team and Support!

    Avatar of GetCodeSnippet.com


    GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    Leave a Reply