private void ExportToBuyUi(ZCBRecord first) { string dirExchange = DirectoryHelper.CombineWithCurrentExeDir("ZcbExchange"); if (!Directory.Exists(dirExchange)) Directory.CreateDirectory(dirExchange); string filePath = Path.Combine(dirExchange, first.ProductionID); FileInfo file = new FileInfo(filePath); if(!file.Exists) file.Create(); }
private void SaveHistory(ZCBRecord first) { FileInfo zcbHistoryFile = new FileInfo (DirectoryHelper.CombineWithCurrentExeDir("ZcbHistory.csv")); zcbHistoryFile.Append( DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").AddQuotes() + "," + first.BuyIndex.ToString(CultureInfo.InvariantCulture).AddQuotes() + Environment.NewLine , Encoding.UTF8 ); }
private void CheckSinleNode(HtmlNode targetNode,int itemIndex) { string yearRate = targetNode.SelectSingleNode(".//*[contains(@class,'f-18')]").InnerText; string dayLeft = GetCleanText(targetNode.SelectSingleNode(".//*[@class='year']").InnerText).Substring(0, 4); string minMount = GetCleanText(targetNode.SelectSingleNode(".//*[@class='w154']").InnerText).Substring(0, 3); string dealCount = GetCleanText(targetNode.SelectSingleNode(".//*[@class='w123']").InnerText).Substring(0, 1); string productionId = targetNode.Attributes["productid"].Value; var record = new ZCBRecord(yearRate, dayLeft, minMount, this.pageIndex, dealCount, productionId, itemIndex); RecordList.Add(record); Console.WriteLine("Page={0:D2} Rate={1} DayLeft={2} MinMount={3} BuyIndex={4:F2} prouctionId={5}", this.pageIndex, yearRate, dayLeft, minMount, record.BuyIndex, record.ProductionID); }