日期:2014-05-20  浏览次数:20798 次

网络采集工具的页面刷新问题
我做了一个小软件,是网络采集方面的。大家可以从这个地址下载试用http://u4.sh.com/ContentPane.aspx?down=ok&filename=Release.rar&filepath=careast%2fRelease.rar&GUID=BF73C745F0C8D689

在程序中我是如下处理的:在页面中找到一条记录,就在datagridview中加入这条记录。如果当前页面找完了,则把这个页面的地址加入到另外一下datagridview中去。大概代码如下:

private   void   GetInfo(List <string>   _urlLst,   List <Regex>   _regRecord,   List <Regex>   _regAcptUrl)   {
                        if   (_urlLst.Count   !=   0)   {
                                urlDepth++;//网址深度
                                List <string>   nextLayerUrlLst   =   new   List <string> ();//下一层次的URL  

                                //遍历_urlLst中每一个链接
                                for   (int   i   =   0;   i   <   _urlLst.Count;   i++)   {
                                        //检查当前链接的页面有没有符合匹配规则的信息,如果有,则把匹配到的依次加入到信息集中                                        
                                       
                                        try   {
                                                //获得网页源码
                                                string   webContent   =   myUtil.GetWebContent(_urlLst[i]);

                                                //获取匹配记录
                                                string[]   tmpValue   =   new   string[_regRecord.Count   +   1];
                                                for   (int   j   =   0;   j   <   _regRecord.Count;   j++)   {
                                                        if   (_regRecord[j].IsMatch(webContent))   {
                                                                tmpValue[j]   =   _regRecord[j].Match(webContent).Groups[1].Value;
                                                        }   else   {