Passing string Value to another Application

4068 views c#

currently, I am working on a comparing program. The system that I really need to develop is to compare folders. But I saw the winmerge application. so in order to shorten my project, the Winmerge is the application that I will use for comparing. but the winmerge did not support an excel file result exporting. that is 1 of my project specifications.

  1. My system has a 3 textbox, the KJOB, JOB, RESULT.
  2. The KJOB and JOB need to pass the string value to WinMerge.

now my question is:

  1. How can I pass the string value of Textbox to Winmerge Application?

I have tried this code to start the Application, but i dont know how to automatically send the path of the folder to start the comparing

Process myProcess = new Process();
                    myProcess.StartInfo.UseShellExecute = false;
                    myProcess.StartInfo.FileName = @"C:\Program Files 
                    myProcess.StartInfo.CreateNoWindow = true;                        

Thanks in Advance. All help will much be appreciated.

answered question

You ought to be doing your research before posting here. That code sets properties of a ProcessStartInfo object and the documentation for that types says "Additionally, you can specify Arguments property values to be command-line arguments to pass to the file's open procedure. For example, if you specify a text editor application in the FileName property, you can use the Arguments property to specify a text file to be opened by the editor". Problem solved with no need to post a question here.

See the WinMerge help file for the command line options. You'll probably want the leftpath and rightpath options.

1 Answer


Not sure I completely understand what is being compared but you would want to pass the contents of your textbox as command line argument(s) to winmerge. Googling led me to this documentation for winmerge, which I think is what you need... Hope this helps!

posted this

Have an answer?


Please login first before posting an answer.