Hi every one, I am using Beyond Compare 3 in my windows forms application using the arguments passing, I am able to compare the files. Every thing is working fine, but I am having some concerns like, I don't want to view the differences window for each and every file.
As my requirement is I have some bunch of files in two folders (like ProdOutput and SITOutput) and I wanted to compare the differences for each file in both the folders (there is same file name in ProdOutput and SITOutput). I am using the below line of code for comparsion.
I am not sure what to do to suppress the launch but wanted to the comparison as normal.
Any help highly appreciated.
As my requirement is I have some bunch of files in two folders (like ProdOutput and SITOutput) and I wanted to compare the differences for each file in both the folders (there is same file name in ProdOutput and SITOutput). I am using the below line of code for comparsion.
//LaunchViewer method code which calls CompareFiles method
string arguments = String.Format("\"{0}\" \"{1}\"", filepath1, filepath2);
ProcessStartInfo psi = new ProcessStartInfo(ApplicationPath, arguments);
using (Process p = Process.Start(psi))
{
ComparsionResult = CompareFiles(filepath1, filepath2);
}
//CompareFiles method code as below
ComparisonResult result = ComparisonResult.None;
string arguments = String.Format("/quickcompare /rules=\"{0}\" \"{1}\" \"{2}\"", ruleName, filepath1, filepath2);
ProcessStartInfo psi = new ProcessStartInfo(ApplicationPath, arguments);
psi.UseShellExecute = false;
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;
using (Process p = Process.Start(psi))
{
p.StandardInput.WriteLine("EXIT [ErrorLevel]");
p.WaitForExit();
int exitCode = p.ExitCode;
switch (exitCode)
{
case 0:
result = ComparisonResult.Match;
break;
case 1:
result = ComparisonResult.Similar;
break;
case 2:
result = ComparisonResult.DoNotMatch;
break;
case 3:
result = ComparisonResult.ComparisonError;
break;
default :
result = ComparisonResult.DoNotMatch;
break;
}
}
string arguments = String.Format("\"{0}\" \"{1}\"", filepath1, filepath2);
ProcessStartInfo psi = new ProcessStartInfo(ApplicationPath, arguments);
using (Process p = Process.Start(psi))
{
ComparsionResult = CompareFiles(filepath1, filepath2);
}
//CompareFiles method code as below
ComparisonResult result = ComparisonResult.None;
string arguments = String.Format("/quickcompare /rules=\"{0}\" \"{1}\" \"{2}\"", ruleName, filepath1, filepath2);
ProcessStartInfo psi = new ProcessStartInfo(ApplicationPath, arguments);
psi.UseShellExecute = false;
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;
using (Process p = Process.Start(psi))
{
p.StandardInput.WriteLine("EXIT [ErrorLevel]");
p.WaitForExit();
int exitCode = p.ExitCode;
switch (exitCode)
{
case 0:
result = ComparisonResult.Match;
break;
case 1:
result = ComparisonResult.Similar;
break;
case 2:
result = ComparisonResult.DoNotMatch;
break;
case 3:
result = ComparisonResult.ComparisonError;
break;
default :
result = ComparisonResult.DoNotMatch;
break;
}
}
Any help highly appreciated.
Comment