Home > Products > CSHTMLDiff Control > Documentation > User Guide

DiffFiles
Previous  Top  Next


 
Performs a diff operation between 2 input files, writing the results to a given output file.  
 
Syntax  
 
Sub DiffFiles(BaseFile As String, RevisedFile As String, outputFile As String, [InlineNavigation As Boolean = True])  
 
Parameters  
 
   BaseFile  
Path of the file that acts as a base for comparison.  
 
   RevisedFile  
Path for the revised version of the base-file.  
 
   outputFile  
Path for the HTML file to which output should be written.  
 
   InlineNavigation  
Specifies whether to include a script for offline diff-navigation.  
 
Remarks  
 
Performs a Diff operation and redirects the output to outputFile. This file can later be viewed independently in a web-browser without having the CSHTMLDiff control installed on the viewer's machine.  
When viewed in a web-browser, the output file will look the same as if the 2 input files were compared and viewed using the CSHTMLDiff control.  
 
Specifying InlineNavigation=True will cause the generated output file to contain an inline navigation script. When viewed in a web-browser, this script allows the user to navigate through the changes in a manner similar to the control's internal navigation abilities.  
 
Note: In server sided applications it is advised to call the SetTempDir method after creating the control object. This method will create an alternative temp directory for the control, thus avoiding security access problems with the default temp directory.  
 
Example  
 
Private Sub DiffFiles_Click()  
   ' perform a diff. include offline-navigation code.  
   diffCtrl1.DiffFiles "C:\LastWeek\Report.html",   
     "C:\ThisWeek\Report.html",    "C:\Temp\DiffResult.html", True  
End Sub  
 
See Also  
 
   DoDiff, DoDiffStreams, Offline Support