What's Changed?
OutputToFile Method (OutputCsvLogic)
Example 



KellermanSoftware.WhatsChanged Namespace > OutputCsvLogic Class : OutputToFile Method
Output the comparison result to a file
Syntax
Public Sub OutputToFile( _
   ByVal result As ComparisonResult, _
   ByVal filePath As String _
) 
Dim instance As OutputCsvLogic
Dim result As ComparisonResult
Dim filePath As String
 
instance.OutputToFile(result, filePath)
public void OutputToFile( 
   ComparisonResult result,
   string filePath
)
public:
void OutputToFile( 
   ComparisonResult^ result,
   String^ filePath
) 

Parameters

result
filePath
Example
CompareLogic compareLogic = new CompareLogic(); //Trial Mode
//CompareLogic compareLogic = new CompareLogic("place user name here", "place license key here"); //License Mode
 
//Compare two strings
string original = "This line was deleted.\r\nThis line is the same.\r\nThis line is a changed.";
string changed = "This line is the same.\r\nThis line was changed.\r\nThis line was added.";
 
ComparisonResult result = compareLogic.CompareStrings(original, changed);
 
//Output to CSV
OutputCsvLogic outputLogic = new OutputCsvLogic();
outputLogic.OutputToFile(result, "OutputCsvTest.csv");
 
//Show the file in the default viewer 
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "OutputCsvTest.csv";
proc.Start();
Dim compareLogic As New CompareLogic() 'Trial Mode
'CompareLogic compareLogic = new CompareLogic("place user name here", "place license key here"); //License Mode
 
'Compare two strings
Dim original As String = "This line was deleted." & vbCrLf & "This line is the same." & vbCrLf & "This line is a changed."
Dim changed As String = "This line is the same." & vbCrLf & "This line was changed." & vbCrLf & "This line was added."
 
Dim result As ComparisonResult = compareLogic.CompareStrings(original, changed)
 
'Output to CSV
Dim outputLogic As New OutputCsvLogic()
outputLogic.OutputToFile(result, "OutputCsvTest.csv")
 
'Show the file in the default viewer 
Dim proc As New System.Diagnostics.Process()
proc.StartInfo.FileName = "OutputCsvTest.csv"
proc.Start()
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

OutputCsvLogic Class
OutputCsvLogic Members