我在 Beyond compare 的文档页面上找到了解决方案。
在文件中添加以下行并使用 My Script.txt 保存
file-report layout:side-by-side &
options:ignore-unimportant,display-context &
output-to:%3 output-options:html-color %1 %2
现在使用命令提示符运行以下代码 BeyondCompate.exe @"My Script.txt" "1.txt" "2.txt" "Save.html" 这会将报告保存在 Save.html 中。
我将其合并到我的代码中:
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = "cmd.exe" ;
startInfo.Arguments = "/c" + "BeyondCompare.exe" + " " + @"My Script.txt" + " " + "1.txt" + " " + "2.txt" + " " +"Save.html";
System.Diagnostics.Process.Start(startInfo);