namespace InternetCommon { public class Internet { public static bool IsInternetAvailable() { try { using (var client = new System.Net.WebClient()) { using (var stream = client.OpenRead("http://www.google.com")) { return true; } } } catch { return false; } } } }