Ejemplo n.º 1
0
 public static bool CheckForInternetConnection()
 {
     try {
         using (var client = new WebClientWithTimeout()) {
             using (client.OpenRead(internetcheckurl)) {
                 return(true);
             }
         }
     } catch {
         return(false);
     }
 }
Ejemplo 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);
     }
 }