Exemple #1
0
 private void HttpDownload(string website)
 {
     if (website.Length > 0)
     {
         TimedWebClient wc = new TimedWebClient();
         wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(FormatHTMLToIPString);
         wc.DownloadStringAsync(new Uri(website));
     }
 }
Exemple #2
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);
 }