/// <summary> /// 重新下载 代理列表 /// </summary> /// <remarks> /// 调用程序定期调用本方法下载最新的代理列表 /// </remarks> public static void ReDownLoadWebProxyList() { AbstractSpider spider = new ProxycnSpider { BeginPageNumber = 1, EndPageNumber = 30 //下载30页 }; var nList = spider.ResultArticleList; //spider.WriteToTxt(Path.Combine(Directory.GetCurrentDirectory(), // string.Format("{0}-{1}.txt", spider.Site.Name, DateTime.Now.ToShortDateString()))); if (nList == null || nList.Count == 0) { Log.Info("ReDownLoadWebProxyList-NULL"); return; } var cList = CheckAllWebProxy(nList); if (cList.Count > 0) { XmlSerializeHelper.SerializeToXml(s_Config_ProxyIPConfigPath, cList); _webProxyIPList = cList; Log.InfoFormat("ReDownLoadWebProxyList-Checked-UPDATE-Num:{0}", cList.Count); } else { Log.Info("ReDownLoadWebProxyList-Checked-NULL"); } }
/// <summary> /// 重新下载 代理列表 /// </summary> /// <remarks> /// 调用程序定期调用本方法下载最新的代理列表 /// </remarks> public static void ReDownLoadWebProxyList() { AbstractSpider spider = new ProxycnSpider { BeginPageNumber = 1, EndPageNumber = 30 //下载30页 }; var nList = spider.ResultArticleList; //spider.WriteToTxt(Path.Combine(Directory.GetCurrentDirectory(), // string.Format("{0}-{1}.txt", spider.Site.Name, DateTime.Now.ToShortDateString()))); if (nList == null || nList.Count == 0) { LogManager.Instance.Info("ReDownLoadWebProxyList-NULL"); return; } var cList = CheckAllWebProxy(nList); if (cList.Count > 0) { XmlSerializeHelper.SerializeToXml(s_Config_ProxyIPConfigPath, cList); _webProxyIPList = cList; LogManager.Instance.Info("ReDownLoadWebProxyList-Checked-UPDATE-Num:{0}", cList.Count); } else LogManager.Instance.Info("ReDownLoadWebProxyList-Checked-NULL"); }