Ethernal_Five

C# - Check if a website is down

Sep 5th, 2011
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.21 KB | None | 0 0
  1. bool DownorNot(string url)
  2.         {
  3.             System.Net.WebClient Web = new System.Net.WebClient();
  4.         try
  5.         {
  6.             Web.DownloadString(url);
  7.         return true;
  8.         }
  9.         catch { return false; }
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment