我必须阅读来自http://www.subway.com/storelocator/default.aspx?zip=04416&country=USA的响应。我使用了以下代码,但没有得到所有响应。而不是它给出错误页面的响应提前谢谢。
protected void Page_Load(object sender, EventArgs e)
{
string sUrl = "http://www.subway.com/storelocator/default.aspx?zip=04416&country=USA";
XmlDocument rssDoc = new XmlDocument();
XmlTextReader rssReader = new XmlTextReader(sUrl.ToString());
WebRequest wrGETURL;
wrGETURL = WebRequest.Create(sUrl);
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
StreamReader objReader = new StreamReader(objStream, Encoding.UTF8);
WebResponse wr = wrGETURL.GetResponse();
Stream receiveStream = wr.GetResponseStream();
StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8);
string content = reader.ReadToEnd();
Response.Write(content);
}