コード例 #1
0
ファイル: ZhaoCaiBaoRobot.cs プロジェクト: cotopboy/nxprice
        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();


        }
コード例 #2
0
ファイル: ZhaoCaiBaoRobot.cs プロジェクト: cotopboy/nxprice
 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
                           );       
 }
コード例 #3
0
ファイル: PageProcessor.cs プロジェクト: cotopboy/nxprice
        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);
        }