D
Dan
This status represents "Page Not Found". However, when I execute the code
below with a purposely bogus URL, GetResponse throws an error before I can
retrieve the 404 status. I've been told on this group that this is the way
it's supposed to work. If that's so, why is 404 included in the
HttpStatusCode enumeration at all; you can never retrieve it.
Dan
try
{
HttpWebResponse response = (HttpWebResponse) m_request.GetResponse();
Console.WriteLine("Status Code = " + response.StatusCode);
}
catch(System.Net.WebException ex)
{
Console.WriteLine(ex.ToString()); // Returns "The remote server returned an
error: (404) Not Found"
}
below with a purposely bogus URL, GetResponse throws an error before I can
retrieve the 404 status. I've been told on this group that this is the way
it's supposed to work. If that's so, why is 404 included in the
HttpStatusCode enumeration at all; you can never retrieve it.
Dan
try
{
HttpWebResponse response = (HttpWebResponse) m_request.GetResponse();
Console.WriteLine("Status Code = " + response.StatusCode);
}
catch(System.Net.WebException ex)
{
Console.WriteLine(ex.ToString()); // Returns "The remote server returned an
error: (404) Not Found"
}