示例#1
0
        private void Do(DirectoryInfo di, SearchOption searchOption)
        {
            foreach (var f in di.GetFiles("*", searchOption))
            {
                // 处理
                string s = f.FullName.Replace(strInput, strOutput) + ".csv";

                AppendText(s + " - ");

                if (bSkip)
                {
                    if (new FileInfo(s).Exists)
                    {
                        AppendText("存在" + Environment.NewLine);
                        continue;
                    }
                }

                try
                {
                    PbTickSerializer.WriteCsv(PbTickSerializer.Read(f.FullName), s);
                    AppendText("成功" + Environment.NewLine);
                }
                catch (Exception ex)
                {
                    AppendText("失败" + Environment.NewLine);
                }
            }
        }
示例#2
0
        private void menuFile_Export_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter = "CSV文件|*.csv";
            DialogResult result = saveFileDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                string pathChosen = saveFileDialog.FileName;

                // 将界面数据生成差分数据
                ViewToDataByViewType();

                PbTickSerializer.WriteCsv(this.listTickData, pathChosen);
            }
        }