T
Tony B
Hi,
When I make a request for a web page using the System.Net.WebClient class
I'm getting a page not found (404) error for a webpage that I know exists.
Here's the relevent bit of code:
aRequestedHTML = objWebClient.DownloadData(strUrl)
strRequestedHTML = objUTF8.GetString(aRequestedHTML)
aRequestedHTML is a byte array, strUrl is a full url such as
http://10.0.1.6/categories/index.asp and strRequestedHTML is the output of
the request.
The exception I get is:
WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at Neop.Module1.ReadWebPage(String strUrl)
The webserver is on the same machine the application runs on. I know the url
exists as I can see it in a browser. Also if I run the application from a
different machine I don't get any errors and the HTML for the page is
returned.
Anyone got any ideas?
Tony
When I make a request for a web page using the System.Net.WebClient class
I'm getting a page not found (404) error for a webpage that I know exists.
Here's the relevent bit of code:
aRequestedHTML = objWebClient.DownloadData(strUrl)
strRequestedHTML = objUTF8.GetString(aRequestedHTML)
aRequestedHTML is a byte array, strUrl is a full url such as
http://10.0.1.6/categories/index.asp and strRequestedHTML is the output of
the request.
The exception I get is:
WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at Neop.Module1.ReadWebPage(String strUrl)
The webserver is on the same machine the application runs on. I know the url
exists as I can see it in a browser. Also if I run the application from a
different machine I don't get any errors and the HTML for the page is
returned.
Anyone got any ideas?
Tony