linq快速比较两个列表
2016-02-24 11:36
447 查看
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
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
相关文章推荐
- HTTP_REFERER有效和无效的情况
- php 3和Zend Guard Loader
- lnmp nginx和php升级方法
- VS2010中程序打包封装步骤
- vs2010 .vb如何生成类库(DLL)
- ms sql根据表明变量动态创建表
- VS 2010令人恼火的Bug:开着…
- [转]ionic tab view hide tab bar
- mysql5.6新特性总结
- mybatis里面xml中SQL语句if语句里嵌套if语句
- Java实现仿微信红包分配规则
- poj 3258 River Hopscotch 二分查找
- RAID相关知识简介
- 机器学习算法概览
- Nginx 变量漫谈(三)
- Host key verification fail…
- .net六种汉字代码转换(gbk_utf8_u…
- 原来电脑也有DNS缓存清空命令ipcon…
- firefox这个功能很酷
- 百度知道规定之多少