コード例 #1
0
        static void OnProxyCrawled(ProxyCrawledEventArgs e)
        {
            ProxyCrawlResult.UpdateCrawledCount(e.ProxySite, 1);

            if (ProxyCrawled != null)
            {
                ProxyCrawled(null, e);
            }
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
 public static void BeginCrawl()
 {
     ProxyCache.Clear();
     ProxyCrawlResult.Clear();
     _tmrGetProxy = new System.Threading.Timer(new TimerCallback(CrawlProxy), null, 0, 1000 * 60 * 30);
 }