关于网页数据采集的问题?求问中! 就是小偷程序有很多种方法的我最常用的就是webclient类了先下载数据,再过滤就可以了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考http://community.csdn.net/Expert/topic/5411/5411610.xml?temp=.2505609 步骤1 private string GetStringByUrl(string strUrl)这里的URL就是你要请求的页面 { WebRequest wrt = WebRequest.Create(strUrl); WebResponse wrse = wrt.GetResponse(); Stream strM = wrse.GetResponseStream(); StreamReader SR = new StreamReader(strM, Encoding.GetEncoding("gb2312")); string strallstrm = SR.ReadToEnd(); return strallstrm; }步骤2 string strPattern = @"对应的正则表达式"; MatchCollection Matches = Regex.Matches(allstrm, strPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); foreach (Match NextMatch in Matches) { 取到的结果= NextMatch.Groups[0].Value.ToString().Trim(); }步骤3:把上面取到的结果放到数据库中。 Sql server 无限递归 散分! 动态生成的label之间如何加空格 手机网站中的参数比较 请教一个关于checkbox绑定数据库的问题? 注销或者退出登陆怎么写? 为什么要将asp.net的web程序在iis中创建为应用程序才能访问,否则就报错? 单机数据库哪种性能最好,如access,sqlite 巨搞笑的问题 Web.config的配置验证问题 http://ine.oicp.net:1001/欢迎大家访问我的wap手机站点, 来者有分 明天去面试ASP.NET(C#),怎么准备一下好呢? DataSet的小问题
{
WebRequest wrt = WebRequest.Create(strUrl);
WebResponse wrse = wrt.GetResponse();
Stream strM = wrse.GetResponseStream();
StreamReader SR = new StreamReader(strM, Encoding.GetEncoding("gb2312"));
string strallstrm = SR.ReadToEnd();
return strallstrm;
}步骤2 string strPattern = @"对应的正则表达式";
MatchCollection Matches = Regex.Matches(allstrm, strPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
foreach (Match NextMatch in Matches)
{
取到的结果= NextMatch.Groups[0].Value.ToString().Trim();
}步骤3:
把上面取到的结果放到数据库中。