I'm working on batch downloader but some URLs are not sending data correctly.
For example, this page: http://i.imgbox.com/absMQK6A.png
In any internet browser, this page shows an image, but in my program, downloads strange data. I think this URL is fake or protected (I don't know HTML well.)
BTW, in IE, I can download that image normally with right click and save as image. so I want to emulate that behavior in my program.
How can I do this?
Below is part of my program's code.
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(DownloadAddress);
if (Proxy != null)
{
request.Proxy = Proxy;
}
if (!string.IsNullOrWhiteSpace(UserAgent))
{
request.UserAgent = UserAgent;
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream downloadHttpStream = response.GetResponseStream();
int read = downloadHttpStream.Read(buffer, 0, buffer.Length);
// output codes
UserAgent is string that has informations of browser. such as IE, Firefox etc.
Thanks.