Hello,
I write a program wich download web pages. It works fine for most of web pages but i have found some pages where it doesn't work.
These pages contains 0x00 characters.
I'm able to read page content until this character, but not the content after.
I use this part of code to read the response :
IAsyncResult ar = null;
HttpWebResponse resp = null;
Stream responseStream = null;
String content = null;
...
resp = (HttpWebResponse)req.EndGetResponse(ar);
responseStream = resp.GetResponseStream();
StreamReader sr = new StreamReader(responseStream, Encoding.UTF8);
content = sr.ReadToEnd();
In this example i use asynchronous request, but i try with synchronous one and i have the same probleme.
I also try this with the same result :
HttpWebResponse resp = null;
Stream responseStream = null;
String content = new String();
...
responseStream = resp.GetResponseStream();
byte[] buffer = new byte[4096];
int bytesRead = 1;
while (bytesRead > 0)
{
bytesRead = responseStream.Read(buffer, 0, 4096);
content += Encoding.UTF8.GetString(buffer, 0, bytesRead);
}
for example, the problem occurs for this url http://www.daz3d.com/i/search/searchsub?sstring=ps%5Ftx1662b&%5Fm=dps%5Ftx1662b
thanks for yours responses
Euyeusu