我有从网站获取响应的简单代码,但有一个小问题。我正在尝试从俄罗斯网站和一个网站获得未知符号的响应,而从另一个网站获得正常文本。哪里可能有问题?
来自:www.kinopoisk.ru 的回复
������ �����...
回复来自:www.yandex.ru
Греция - Чехия。1:2...
HttpWebRequest http = (HttpWebRequest) HttpWebRequest.Create("http://");
http.Timeout = 30000;
http.KeepAlive = true;
http.ContentType = "application/x-www-form-urlencoded";
http.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0";
http.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
http.Proxy = null;
WebResponse response = http.GetResponse();
Stream istream = response.GetResponseStream();
StreamReader reader = new StreamReader(istream);
Response.Write(reader.ReadToEnd());
reader.Close();