问题
I have a small C# app and I'd like to provide the ability to preview diffs and accept changes. My inputs are only text files. I came across some tools like kdiff3 and winmerge and I was wondering if anyone's integrated them inside a C# app and if yes, how was it done? I also came across some nice projects on CodeProject from an earlier stackoverflow question but since those projects were written in 2004, I was wondering if you have any suggestions for an open source diff and merge tool that I can integrate? Thanks!
回答1:
Have you checked out csdiff ?
http://code.google.com/p/csdiff/
回答2:
Winmerge, as you mentioned, can be integrated with other apps via the command line. Here's an example of visual studio using these command line parameters to replace the built in diff client. In regards to launching winmerge itself, I found this simple example of how to call an external program from C#.
回答3:
You might want to checkout DiffPlex. It is (amongst other things) a library that can be used to generate text diffs. It also provides some higher level classes that provide a more complete "diff model" that should be easier to use for rendering diffs in, say, a textbox or.
Personally, I have not used it and the last update is from May 2011. Other than that, it looks quite promising.
来源:https://stackoverflow.com/questions/12505851/diff-tool-that-can-be-integrated-into-a-c-sharp-app