示例#1
0
        public MainForm()
        {
            InitializeComponent();

            this.Text += " - " + Application.ProductVersion.ToString();

            string        strIniFile = Application.StartupPath + "/config.ini";
            StringBuilder sb         = new StringBuilder(255);

            FileFolderHelper.ReadIniFile("General", "compareApplicationPath", "", sb, 255, strIniFile);
            compareApplicationPath = sb.ToString();
            Init();
            LoadHistory();
        }
示例#2
0
        private void buttonGenAllDiff_Click(object sender, EventArgs e) // 批量生成差异结果
        {
            string outFolder = FileFolderHelper.BrowserFolder("请选择输出路径。");

            if (outFolder.Length == 0)
            {
                MessageBox.Show("你取消了此次命令。");
                return;
            }

            string        strIniFile = Application.StartupPath + "/config_public.ini";
            StringBuilder sb         = new StringBuilder(255);

            FileFolderHelper.ReadIniFile("DiffDirList", "Count", "", sb, 255, strIniFile);
            int pathCount = Convert.ToInt32(sb.ToString());

            string[] paths = new string[pathCount];

            for (int i = 1; i <= pathCount; i++)
            {
                FileFolderHelper.ReadIniFile("DiffDirList", "Dir" + i.ToString(), "", sb, 255, strIniFile);
                paths[i - 1] = sb.ToString();
            }

            m_diffColInfo = new Hashtable();
            FileFolderHelper.ReadIniFile("DiffColumns", "Count", "", sb, 255, strIniFile);
            int diffColDescCount = Convert.ToInt32(sb.ToString());

            for (int i = 1; i <= diffColDescCount; i++)
            {
                FileFolderHelper.ReadIniFile("DiffColumns", "Table" + i.ToString(), "", sb, 255, strIniFile);
                string      tblname = sb.ToString();
                DiffColInfo dci     = new DiffColInfo();
                FileFolderHelper.ReadIniFile("DiffColumns", "Keys" + i.ToString(), "", sb, 255, strIniFile);
                dci.keys = sb.ToString();
                FileFolderHelper.ReadIniFile("DiffColumns", "Display" + i.ToString(), "", sb, 255, strIniFile);
                dci.displays = sb.ToString();
                m_diffColInfo.Add(tblname.ToLower(), dci);
            }

            m_diffLog = string.Empty;
            foreach (string dir in paths)
            {
                GenerateTabDiffOutput(dir, outFolder);
            }
            FileFolderHelper.StringToFile(m_diffLog, Path.Combine(Application.StartupPath, "diff.log"));
        }