How To Get Error number in WebException Error?
try { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(\"site\"); HttpWebResponse response
You'll want to run a test to make sure that it was a ProtocolError:
ProtocolError
if (e.Status == WebExceptionStatus.ProtocolError) { Console.WriteLine("Status Code : {0}", ((HttpWebResponse)e.Response).StatusCode); Console.WriteLine("Status Description : {0}", ((HttpWebResponse)e.Response).StatusDescription); }