2017-07-10 25 views
0

我正在开发一个Windows窗体应用程序在c#中,将更改文档,我想包括一个按钮,将打开winmerge前后。打开winmerge与两个并排的文件c#

如果可能,我该怎么做?

更多详细信息:

我想点击一个按钮Show Result在文本框中启动文件。 它应该打开winmerge并打开this dialog左边的原始文件和右边的更新文件。

到目前为止,我有:

Process notePad = new Process(); 
    notePad.StartInfo.FileName = "WinMerge.exe"; 
    notePad.StartInfo.Arguments = txtIn.Text; 
    notePad.Start(); 

更新的文件在同一目录中输入文件一个名为文件夹中下水平“更新”的

+2

欢迎来到SO。你的问题有点太开放了,这样就不太可能有人能够提供帮助 - 请提供更多细节:你在寻找关于如何从命令行调用winmerge的细节?也许你对如何使用Winforms提供文件编辑GUI感到困惑?祝你好运! –

回答

1

的WinMerge has command line parameters,这是在记录他们的现场。

最小的命令行用法似乎是这样的:

winmergeu leftpath rightpath 

您可以运行通过调用Process.Start()使用适当的参数。

String leftFilePath = "..."; 
String rightFilePath = "..."; 

// This will do, if the winmerge exe is in the search path. 
string exe = "winmergeu.exe"; 
String args = [email protected]"""{leftFilePath}"" ""{rightFilePath}"""; 

Process.Start(exe, args); 

您可能希望存储您的前后文本in temp files