asp.net怎么采集入库
如题 --------------------编程问答-------------------- 你是要做数据采集么,联系我,QQ号码:940729677 --------------------编程问答----------------------------------------编程问答-------------------- 1.获取网页源码
private static string GetPage(string url)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse webResponse = null;
try
{
webResponse = (HttpWebResponse)webRequest.GetResponse();
}
catch (WebException ex)
{
webResponse = (HttpWebResponse)ex.Response;
}
Stream stream = webResponse.GetResponseStream();
StreamReader reader = new StreamReader(stream, System.Text.Encoding.GetEncoding("gb2312"));
//整个页面内容
string content = reader.ReadToEnd();
reader.Close();
webResponse.Close();
return content.Replace("<script", " ");
}
2.利用正则获取你想要的内容
3.入库
4.再循环第一步操作
补充:.NET技术 , ASP.NET