文檔半島外圍網(wǎng)上直營>>E-iceblue中文文檔>>比較兩個(gè) Word 文檔
                比較兩個(gè) Word 文檔
Spire.Doc for .NET 支持比較兩個(gè) Word 文檔并找出它們之間的差異。在本文中,您將學(xué)習(xí)如何使用 Spire.Doc for .NET 來比較 C# 和 VB.NET 中的兩個(gè) Word 文檔。
輸入的 Word 文檔:
	 
 
【C#】
	
using Spire.Doc;
namespace CompareWordDocuments
{
class Program
{
static void Main(string[] args)
{
//Create a Document instance
Document doc1 = new Document();
//Load the first Word document
doc1.LoadFromFile("Doc1.docx");
//Create a Document instance
Document doc2 = new Document();
//Load the second Word document
doc2.LoadFromFile("Doc2.docx");
//Compare the two Word documents
doc1.Compare(doc2, "Shawn");
//Save the result to file
doc1.SaveToFile("Result.docx");
doc1.Dispose();
}
}
}
	
【VB.NET】
	
Imports Spire.Doc
Namespace CompareWordDocuments
Class Program
Private Shared Sub Main(ByVal args As String())
‘Create a Document instance
Dim doc1 As Document = New Document()
‘Load the first Word document
doc1.LoadFromFile("Doc1.docx")
‘Create a Document instance
Dim doc2 As Document = New Document()
‘Load the second Word document
doc2.LoadFromFile("Doc2.docx")
‘Compare the two Word documents
doc1.Compare(doc2, "Shawn")
‘Save the result to file
doc1.SaveToFile("Result.docx")
doc1.Dispose()
End Sub
End Class
End Namespace
	
輸出:
	 
 
歡迎下載|體驗(yàn)更多E-iceblue產(chǎn)品
	如需獲取更多產(chǎn)品相關(guān)信息請(qǐng)咨詢  
  
 

 QQ交談
QQ交談 在線咨詢
在線咨詢 
                 
                
 渝公網(wǎng)安備
            50010702500608號(hào)
渝公網(wǎng)安備
            50010702500608號(hào)
             
            
 客服熱線
客服熱線