Exemplo n.º 1
0
        private void Crawler_CrawlerStopped(ParallelCrawler obj)
        {
            Action action = () => lblInfo.Text = "爬虫已停止";

            if (this.InvokeRequired)
            {
                this.Invoke(action);
            }
            else
            {
                action();
            }
        }
Exemplo n.º 2
0
        private void Crawler_PageDownloaded(ParallelCrawler crawler, int index, string url, string info)
        {
            var    pageInfo = new { Index = index, URL = url, Status = info };
            Action action   = () => { BS.Add(pageInfo); };

            if (this.InvokeRequired)
            {
                this.Invoke(action);
            }
            else
            {
                action();
            }
        }