2010/2/2 12:08:22
asp.net抓取网页(可以利用来生成静态网页)
asp.net抓取网页(可以利用来生成静态网页)
主要利用System.Net.WebClient类
System.Net.WebClient wb = new System.Net.WebClient();
byte[] PageSources = wb.DownloadData(link);//link就是页面地址
string Encode = “UTF-8”;//编码
string Sources = System.Text.Encoding.GetEncoding(Encode).GetString(PageSources);
return Sources;
System.Net.WebClient wb = new System.Net.WebClient();
byte[] PageSources = wb.DownloadData(link);//link就是页面地址
string Encode = “UTF-8”;//编码
string Sources = System.Text.Encoding.GetEncoding(Encode).GetString(PageSources);
return Sources;