就是对这个地址发一个请求,得到返回的xml数据,试试下面这个方法,传入地址就OK了:
public static string GetHtml(string Url)
{
string strResult = "";
try
{
Uri uri = new Uri(Url);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "GET";
request.AllowAutoRedirect = true;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream streamReceive = response.GetResponseStream();
Encoding encoding = Encoding.UTF8;
StreamReader streamReader = new StreamReader(streamReceive, encoding);
strResult = streamReader.ReadToEnd();
}
catch
{
return "error";
}
return strResult;
}