private void tsmi_getTXFFCHistoryFromWeb_Click(object sender, EventArgs e) { Application.DoEvents(); TXFFC_HtmlDataClass rder = new TXFFC_HtmlDataClass(GlobalClass.TypeDataPoints["TXFFC"]); TXFFCExpectReader er = new TXFFCExpectReader(); string StrBegDate = "2018-08-25"; ExpectList <TimeSerialData> el = er.GetMissedData <TimeSerialData>(true, StrBegDate); for (int i = 0; i < el.Count; i++) { ExpectList <TimeSerialData> tmpList = new ExpectList <TimeSerialData>(); DateTime endT = el[i].OpenTime; DateTime begT = el[i].OpenTime.AddMinutes(-1 * el[i].MissedCnt - 1); DateTime tt = DateTime.Parse(begT.ToShortDateString()); DateTime begT0 = tt; while (tt <= endT) { string strTt = tt.ToString("yyyy-MM-dd"); for (int j = 1; j <= 29; j++) { ExpectList <TimeSerialData> wlist = rder.getHistoryData <TimeSerialData>(strTt, j);//取到web tmpList = ExpectList <TimeSerialData> .Concat(tmpList, wlist); Application.DoEvents(); Thread.Sleep(800); } tt = tt.AddDays(1); } ExpectList <TimeSerialData> currEl = er.ReadHistory <TimeSerialData>(begT0.ToString(), endT.AddDays(1).ToString()); er.SaveHistoryData(er.getNewestData(tmpList, currEl)); } }
private void tsmi_getTXFFCHistoryTxtData_Click(object sender, EventArgs e) { TXFFCExpectReader er = new TXFFCExpectReader(); TXFFC_HtmlDataClass rder = new TXFFC_HtmlDataClass(GlobalClass.TypeDataPoints["TXFFC"]); string strFolder = @"C:\Users\zhouys\Desktop\TXFFC"; string fileType = "txt"; DirectoryInfo dir = new DirectoryInfo(strFolder); FileInfo[] fil = dir.GetFiles(); foreach (FileInfo f in fil) { long size = f.Length; if (f.FullName.ToLower().Substring(f.FullName.Length - fileType.Length) != fileType.ToLower()) { continue;//非指定类型跳过 } ExpectList <TimeSerialData> el = rder.getFileData <TimeSerialData>(f.FullName); TXFFCExpectReader rd = new TXFFCExpectReader(); ExpectList <TimeSerialData> currEl = rd.ReadHistory <TimeSerialData>(); rd.SaveHistoryData(rd.getNewestData(el, currEl)); //currEl = rd.ReadNewestData(DateTime.Now.AddDays(-1)); //FillOrgData(listView_TXFFCData, currEl); } }
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); }