C# winfrom WebRequest获取html网页信息 引用using
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的专栏
补充:软件开发 , C# ,