Categories

Category Specific RSS

Is Internet Connection Available in C sharp

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.NetworkInformation;

namespace Common {
public static class MailHelper {

public static bool InternetConnectionAvailable( ) {
bool result = false;
Ping ping = new Ping( );
PingReply reply = null;
try {
reply = ping.Send( “www.google.com” );
result = reply.Status == IPStatus.Success;
} catch ( Exception ) {

}

return result;
}

}
}

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare

Leave a Reply