2014-01-06 1 views
3

비교를 사용하여 두 파일을 비교할 코드 조각이 있습니다.비교 프로그램에서 생성 한 비교 보고서를 저장하는 방법

이제 파일 이름과 내 데스크톱의 위치를 ​​프로그래밍 방식으로 비교 보고서에 저장하려고합니다.

문서를 검색했지만 보고서를 저장할 때 아무것도 찾을 수 없습니다. 이미지 에서 볼 수 있습니다로

는 현재 위의 코드 실행이 창을 엽니 다 don't get confused with the black part on the window, i have colored it that way to hide file locations

을 (창에 검은 부분과 혼동하지, 난 그것을 파일 위치를 숨길 수있는 그런 식으로 착색 한) 미리 감사드립니다.

답변

1

Beyond의 설명서 페이지에서 해결책을 찾았습니다.

파일에 다음 줄을 추가하고 이제 명령 프롬프트에 다음 코드 "내 Script.txt를"@ BeyondCompate.exe "1.TXT"를 "실행 사용하여 내 Script.txt를

file-report layout:side-by-side & 
options:ignore-unimportant,display-context & 
output-to:%3 output-options:html-color %1 %2 

으로 저장 2.txt ""Save.html " 그러면 Save.html에 보고서가 저장됩니다.

나는 나의 코드에서이 통합 : 참조 사용 "/ C"인 이유에

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); 
+0

알고 http://stackoverflow.com/questions/5047171/passing-an-argument-to -cmd-exe – anurag