private void Monitoring_Load(object sender, EventArgs e) { Thread re = new Thread(new ThreadStart(Report)); re.IsBackground = true; re.Start(); tri = new TbReleaseInfo(); FormatDataView(dvAll, false); FormatDataView(dvBBs, false); FormatDataView(dvBlog, false); FormatDataView(dvWBlog, true); FormatDataView(dvWeb, false); dtnewsinfo = tri.GetReleaseInfoFormat(); dtbloginfo = tri.GetReleaseInfoFormat(); dtbbsinfo = tri.GetReleaseInfoFormat(); dtqueryinfo = tri.GetReleaseInfoFormat(); dtWebNewsInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-15).ToString("yyyy-MM-dd HH:mm:ss"), "0 AND webName<>'百度'"); dvWeb.DataSource = dtnewsinfo; dtWebBlogInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-15).ToString("yyyy-MM-dd HH:mm:ss"), "1"); dvBlog.DataSource = dtbloginfo; dtWebBBSInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-15).ToString("yyyy-MM-dd HH:mm:ss"), "2"); dvBBs.DataSource = dtbbsinfo; dtWebQueryInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-15).ToString("yyyy-MM-dd HH:mm:ss"), "0 AND webName='百度'"); dvAll.DataSource = dtqueryinfo; }
private void Monitoring_Load(object sender, EventArgs e) { weiboSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(weiboSpiderTimer_Elapsed); weiboSpiderTimer.AutoReset = true; weiboSpiderTimer.Enabled = false; webSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(webSpiderTimer_Elapsed); webSpiderTimer.AutoReset = true; webSpiderTimer.Enabled = false; tri = new TbReleaseInfo(); FormatDataView(dvAll, false); FormatDataView(dvBBs, false); FormatDataView(dvBlog, false); FormatDataView(dvWBlog, true); FormatDataView(dvWeb, false); FormatDataView(dvtieba, false); FormatDataView(dvWeiXin, false); dtnewsinfo = tri.GetReleaseInfoFormat(); dttiebainfo = tri.GetReleaseInfoFormat(); dtbloginfo = tri.GetReleaseInfoFormat(); dtbbsinfo = tri.GetReleaseInfoFormat(); dtqueryinfo = tri.GetReleaseInfoFormat(); dtweixininfo = tri.GetReleaseInfoFormat(); dtWebNewsInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss"), "0 AND webName<>'百度'"); dvWeb.DataSource = dtnewsinfo; dtTieBaInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss"), "5"); dvtieba.DataSource = dttiebainfo; dtWebBlogInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss"), "1"); dvBlog.DataSource = dtbloginfo; dtWebBBSInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss"), "2"); dvBBs.DataSource = dtbbsinfo; dtWebQueryInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss"), "4"); dvAll.DataSource = dtqueryinfo; dtWeiXinInfo = tri.SelReleaseInfo(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss"), "6"); dvWeiXin.DataSource = dtweixininfo; SoftVer = !GlobalPars.GloPars.ContainsKey("SoftVer")? "1" : GlobalPars.GloPars["SoftVer"].ToString(); if (!SoftVer.Equals("3")) { tabControl1.TabPages.RemoveByKey("tabPage7"); } }
private void Monitoring_Load(object sender, EventArgs e) { #region 抓取定时器设置 //2015.3.9 wangcg 通用抓取 GeneralWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(GeneralWebSpiderTimer_Elapsed); GeneralWebSpiderTimer.AutoReset = true; GeneralWebSpiderTimer.Enabled = false; //2015.3.10 wangcg 主流媒体抓取 MediaWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(MediaWebSpiderTimer_Elapsed); MediaWebSpiderTimer.AutoReset = true; MediaWebSpiderTimer.Enabled = false; //2015.3.11 wangcg 微信抓取 WeixinWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(WeixinWebSpiderTimer_Elapsed); WeixinWebSpiderTimer.AutoReset = true; WeixinWebSpiderTimer.Enabled = false; //2015.3.11 wangcg 博客抓取 BlogWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(BlogWebSpiderTimer_Elapsed); BlogWebSpiderTimer.AutoReset = true; BlogWebSpiderTimer.Enabled = false; //2015.3.11 wangcg 论坛抓取 BBSWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(BBSWebSpiderTimer_Elapsed); BBSWebSpiderTimer.AutoReset = true; BBSWebSpiderTimer.Enabled = false; //2015.3.14 wangcg 贴吧抓取 TiebaWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(TiebaWebSpiderTimer_Elapsed); TiebaWebSpiderTimer.AutoReset = true; TiebaWebSpiderTimer.Enabled = false; //2015.3.14 wangcg 新浪微博抓取 WeiboWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(WeiboWebSpiderTimer_Elapsed); WeiboWebSpiderTimer.AutoReset = true; WeiboWebSpiderTimer.Enabled = false; //2015.3.17 wangcg 百度网页搜索抓取 BaiduWebWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(BaiduWebWebSpiderTimer_Elapsed); BaiduWebWebSpiderTimer.AutoReset = true; BaiduWebWebSpiderTimer.Enabled = false; #endregion RefreshWebSpiderTimer.Elapsed += new System.Timers.ElapsedEventHandler(RefreshDataTimer_Elapsed); RefreshWebSpiderTimer.AutoReset = true; RefreshWebSpiderTimer.Enabled = false; #region 初始化表格控件 tri = new TbReleaseInfo(); FormatDataView2(dvView); dtData = tri.GetReleaseInfoFormat(); dvView.DataSource = dtData; #endregion SoftVer = !GlobalPars.GloPars.ContainsKey("SoftVer") ? "1" : GlobalPars.GloPars["SoftVer"].ToString(); if (!SoftVer.Equals("3")) { //不能使用微信 //tabControl1.TabPages.RemoveByKey("tabPage7"); chkWeixin.Visible = false; } chkAllWeb.Checked = true; chkBBS.Checked = true; chkBlog.Checked = true; chkCustom.Checked = true; chkMedia.Checked = true; chkTieba.Checked = true; chkWeixin.Checked = true; kidlist.SelectedIndex = 4; //事件类型 (默认选择全部) kwlist.SelectedIndex = 0; //事件名称 (启动时隐藏) kwlist.Hide(); //事件名称 label8.Hide(); //事件名称 selectKID = -1; #region 提取事件与关键字 DataTable kwdtAll = cmd.GetTabel("select name, keyword from keywords"); for (int i = 0; i < kwdtAll.Rows.Count; i++) { string key = kwdtAll.Rows[i]["name"].ToString(); if (!dicKeywords.ContainsKey(key)) { List<string> keywords = new List<string>(); keywords.Add(kwdtAll.Rows[i]["keyword"].ToString()); dicKeywords.Add(key, keywords); } else { dicKeywords[key].Add(kwdtAll.Rows[i]["keyword"].ToString()); } } #endregion }