I am writing an application that needs to download a webpage. however i use this code scheme to get html :
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
System.IO.Stream data = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(data, true);
string htmlCode = reader.ReadToEnd();
i have a problem with urls from this site : http://www.jamejamonline.ir/
When i try to get a page in this way, redirected to error page,
but all webbrowsers show correct html page.
how can i get around this problem?
specify an user agent like this
I tried it and it worked!