日期:2014-05-17 浏览次数:21246 次
private string getbody(string url)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string ret = string.Empty;
if (response.StatusCode == HttpStatusCode.OK)
{
System.IO.MemoryStream stream = (System.IO.MemoryStream)response.GetResponseStream();
////在这儿处理返回的文本就OK了,如:
ret = stream.ToString();
}
return ret;
}