private string GetHtmlinfo(string PageUrl)
{
WebRequest request = WebRequest.Create(PageUrl);
WebResponse response = request.GetResponse();
Stream resStream = response.GetResponseStream();
StreamReader sr = new StreamReader(resStream, System.Text.Encoding.Default);
string htmlinfo = sr.ReadToEnd();
resStream.Close();
sr.Close();
return htmlinfo;
}
摘自 Bychentufeiyang的專欄