Beispiel #1
0
 public static bool TryWebsite(string website, ref bool error)
 {
     try
     {
         using (var client = new TimedWebClient())
             using (client.OpenRead(website))
                 error = false;
         return(true);
     }
     catch (WebException ex)
     {
         //TODO: Logging if a particular link timedOut (needs replacement or checking) GUI feedback if this occurs.
     }
     catch (OperationCanceledException ex)
     {
         //TODO: Logging which one is slower. GUI Feedback of stats on website speeds.
     }
     return(false);
 }