/// <summary> /// 比较稳健 /// </summary> /// <param name="filePath1">源比较文件路径</param> /// <param name="filePath2">目标比较文件路径</param> public void CompareFile(string filePath1, string filePath2) { List <string> keyList = GetKeyList(filePath1); KeyConfigForm kForm = new KeyConfigForm(keyList); if (kForm.ShowDialog() == DialogResult.OK) { string postfix = "tab"; string keys = kForm.KeyString; string namefield = kForm.DisplayField; string rowcondition = kForm.RowCondition; string output = string.Empty; string outputbasic = string.Empty; List <string> diffCols1 = new List <string>(); List <string> diffCols2 = new List <string>(); DiffGenerator.DiffGen(filePath1, filePath2, postfix, keys, namefield, rowcondition, ref output, ref outputbasic, ref diffCols1, ref diffCols2); // diffView FileInfo fi = new FileInfo(filePath1); DiffViewer.DiffView(fi.Name, postfix, keys, namefield, output, outputbasic, diffCols1, diffCols2); } }
/// <summary> /// 比较稳健 /// </summary> /// <param name="filePath1">源比较文件路径</param> /// <param name="filePath2">目标比较文件路径</param> public void CompareFile(string filePath1, string filePath2) { List<string> keyList = GetKeyList(filePath1); KeyConfigForm kForm = new KeyConfigForm(keyList); if (kForm.ShowDialog() == DialogResult.OK) { string postfix = "tab"; string keys = kForm.KeyString; string namefield = kForm.DisplayField; string rowcondition = kForm.RowCondition; string output = string.Empty; string outputbasic = string.Empty; List<string> diffCols1 = new List<string>(); List<string> diffCols2 = new List<string>(); DiffGenerator.DiffGen(filePath1, filePath2, postfix, keys, namefield, rowcondition, ref output, ref outputbasic, ref diffCols1, ref diffCols2); // diffView FileInfo fi = new FileInfo(filePath1); DiffViewer.DiffView(fi.Name, postfix, keys, namefield, output, outputbasic, diffCols1, diffCols2); } }