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