I have a site that returns a custom 404 page, I need to get the source code of it and determine what kind of 404 it's returning. Is there a way to get the source code of the 404 page?
try
{
using (var webClient = new WebClient())
{
webClient.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0)");
webClient.DownloadFile(new Uri(file.Address), file.SaveLocation);
}
}
catch (WebException e)
{
// read source code here...
}