static void OnProxyCrawled(ProxyCrawledEventArgs e) { ProxyCrawlResult.UpdateCrawledCount(e.ProxySite, 1); if (ProxyCrawled != null) { ProxyCrawled(null, e); } }
static void OnProxyValidated(string ip, int port, string proxySite, bool isValid) { if (isValid) { ProxyCrawlResult.UpdateValidCount(proxySite, 1); } else { ProxyCrawlResult.UpdateInvalidCount(proxySite, 1); } if (ProxyValidated != null) { ProxyValidated(null, new ProxyValidatedEventArgs(proxySite, ip, port, isValid)); } }
public static void BeginCrawl() { ProxyCache.Clear(); ProxyCrawlResult.Clear(); _tmrGetProxy = new System.Threading.Timer(new TimerCallback(CrawlProxy), null, 0, 1000 * 60 * 30); }