Sub compareLists(ByVal
lst1 As String(), ByVal lst2 As String())
‘通过对话框获取两个药对比文件的数据到两个列表。
Dim ofdg1 As New OpenFileDialog
Dim ofdg2 As New OpenFileDialog
Dim path1 As String = String.Empty
Dim path2 As String = String.Empty
If ofdg1.ShowDialog = vbOK Then
path1 =
ofdg1.FileName
End If
If ofdg2.ShowDialog = vbOK Then
path2 =
ofdg2.FileName
End If
If System.IO.File.Exists(path1) And
System.IO.File.Exists(path2) Then
Dim list1
As String() = System.IO.File.ReadAllLines(path1)
Dim list2
As String() = System.IO.File.ReadAllLines(path2)
compareLists(list1, list2)
End If
Dim differenceQuery = lst1.Except(lst2)
' Execute the query.
For Each name As String In differenceQuery
Debug.Print(name)
Next
End Sub