Exemplo n.º 1
0
 private void AllForm_Load(object sender, EventArgs e)
 {
     //填充待抓取的数据资源名称
     //DataTable dtName = new DataTable();
     //dtName.Columns.Add("check", System.Type.GetType("System.Boolean"));
     //dtName.Columns["check"].ReadOnly = false;
     //dtName.Columns.Add("name", System.Type.GetType("System.String"));
     //for (int i = 0; i < tableNames.Length; i++)
     //{
     //    dtName.Rows.Add(false, tableNames[i]);
     //}
     //this.gcName.DataSource = dtName;
     hgzUtils           = new HGZUtils("HGZ", null, this.CrawlerLog);
     pzUtils            = new PZUtils("PZ", null, this.CrawlerLog);
     wsUtils            = new WSUtils("WS", null, this.CrawlerLog);
     hgzUtilsPool       = new HGZUtilsThreadPool("HGZ", null, this.CrawlerLog);
     this.txtTime.Text  = Settings.Default.RunT;
     this.txtTime.Text  = Settings.Default.RunMinute;
     this.dtStart1.Text = DateTime.Now.Date.AddDays(-1).ToString();
 }
Exemplo n.º 2
0
        //开始自动抓取
        private void HGZ_Start()
        {
            try
            {
                string param = queryParam("HGZ");
                this.CrawlerLog.Invoke(new Action(() =>
                {
                    this.CrawlerLog.Items.Add(string.Format("{0} 开始抓取机动车合格证申请数据  ", DateTime.Now.ToString("G")));
                }));
                //this.CrawlerLog.SelectedIndex = 0;

                //hgzUtils = new HGZUtils("HGZ", null, this.CrawlerLog);
                //hgzUtils.StartThreadPool("", "1", "");
                hgzUtilsPool = new HGZUtilsThreadPool("HGZ", null, this.CrawlerLog);
                hgzUtilsPool.StartThreadPool(param, "1", "");
            }
            catch (Exception ex)
            {
                MessageBox.Show("机动车合格证申请抓取开始异常:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 3
0
        //开始自动抓取
        private void barBtnItemStart_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                this.barBtnItemStart.Enabled = false;
                this.barBtnStop.Enabled      = true;

                this.CrawlerLog.Invoke(new Action(() =>
                {
                    this.CrawlerLog.Items.Add(string.Format("{0} 开始抓取机动车合格证申请数据  ", DateTime.Now.ToString("G")));
                }));
                this.CrawlerLog.SelectedIndex = 0;

                //hgzUtils = new HGZUtils("HGZ", this.gridControl1, this.CrawlerLog);
                //hgzUtils.StartThreadPool("", "1", "");
                hgzUtilsPool = new HGZUtilsThreadPool("HGZ", this.gridControl1, this.CrawlerLog);
                hgzUtilsPool.StartThreadPool("", "1", "1000");
            }
            catch (Exception ex)
            {
                MessageBox.Show("抓取开始异常:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 4
0
 private void HGZForm_Load(object sender, EventArgs e)
 {
     hgzUtils     = new HGZUtils("HGZ", this.gridControl1, this.CrawlerLog);
     hgzUtilsPool = new HGZUtilsThreadPool("HGZ", this.gridControl1, this.CrawlerLog);
 }