private void timer_For_getHtmlData_Tick(object sender, EventArgs e) { int secCnt = DateTime.Now.Second; if (secCnt > 10) { timer_For_getHtmlData.Interval = (7 + 60 - secCnt) * 1000; } else if (secCnt < 7) { timer_For_getHtmlData.Interval = (7 - secCnt) * 1000; } else { timer_For_getHtmlData.Interval = 60000; } TXFFC_HtmlDataClass hdc = new TXFFC_HtmlDataClass(); ExpectList el = hdc.getExpectList(); TXFFCExpectReader rd = new TXFFCExpectReader(); ExpectList currEl = rd.ReadNewestData(DateTime.Now.AddDays(-1)); rd.SaveNewestData(rd.getNewestData(el, currEl)); currEl = rd.ReadNewestData(DateTime.Now.AddDays(-1)); FillOrgData(listView_TXFFCData, currEl); }
private void ReceiveTXFFCData() { int secCnt = DateTime.Now.Second; TXFFC_HtmlDataClass hdc = new TXFFC_HtmlDataClass(); ExpectList el = hdc.getExpectList(); if (el == null || el.LastData == null) { Tm_ForTXFFC.Interval = 5 * 1000; return; } if (Int64.Parse(el.LastData.Expect) > lastFFCNo) { lastFFCNo = Int64.Parse(el.LastData.Expect); if (secCnt > 10) { Tm_ForTXFFC.Interval = (7 + 60 - secCnt) * 1000; } else if (secCnt < 7) { Tm_ForTXFFC.Interval = (7 - secCnt) * 1000; } else { Tm_ForTXFFC.Interval = 60 * 1000; } } else { Tm_ForTXFFC.Interval = 5 * 1000; return; } //Log("保存分分彩数据", string.Format("期号:{0}",lastFFCNo)); TXFFCExpectReader rd = new TXFFCExpectReader(); ExpectList currEl = rd.ReadNewestData(DateTime.Now.AddDays(-1)); rd.SaveNewestData(rd.getNewestData(el, currEl)); currEl = rd.ReadNewestData(DateTime.Now.AddDays(-1)); //FillOrgData(listView_TXFFCData, currEl); }