public static bool CheckForInternetConnection() { try { using (var client = new WebClientWithTimeout()) { using (client.OpenRead(internetcheckurl)) { return(true); } } } catch { return(false); } }
public static bool CheckForInternetConnection() { try { using (var client = new WebClientWithTimeout()) { using (client.OpenRead("http://clients3.google.com/generate_204")) { return(true); } } } catch { return(false); } }