Beispiel #1
0
        private void RunNewTask(DataGridViewCellEventArgs e)
        {
            //开始新的任务                    
            SetWorkingState(e);
            //SetCrawler();
            kiwiConsole.ClearOutput();
            fileId = 0;
            //tempGridview = dgvTaskCapture;
            master = SetCrawler();
            kiwiThreadStatus = master.ThreadStatus;
            strExit = "";
            timer.Start();//20151204暂时注释掉
            //isKillTask = false;
            isWriteTaskOver = false;
            for (int i = 0; i < kiwiThreadStatus.Count(); i++)
            {
                strExit += "true";
            }
            //if (ckbDetail2Mode.Checked)
            //{
            //    isDetailMode2 = true;
            //}
            //else
            //{
            //    isDetailMode2 = false;
            //}

            master.Crawl();
            writeThread = new Thread(WriteToDB);
            writeThread.Start();
        }
Beispiel #2
0
        private static CrawlMaster SetCrawler()
        {
            //SettingDefaultValues();
            //SettingCustomValues();
            var master = new CrawlMaster(Settings);
            master.AddUrlEvent += MasterAddUrlEvent;
            master.DataReceivedEvent += MasterDataReceivedEvent;
            // master.CustomParseLinkEvent2 += Master_CustomParseLinkEvent2;
            master.CustomParseLinkEvent3 += Master_CustomParseLinkEvent3;
            //master.CustomParseLinkEvent3 += Master_Over;

            return master;
        }