Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. What exception or http status code for when the server is down
  2. try
  3.         {
  4.             WebRequest webRequest = WebRequest.Create(uri);
  5.             webRequest.Method = "GET";
  6.  
  7.             HttpWebResponse httpWebResponse = (HttpWebResponse)webRequest.GetResponse();                            
  8.  
  9.         }
  10.         catch ()  //what excpetion will tell me server is down??
  11.         {
  12.            ...
  13.         }