标签:os ar for sp 文件 ad bs ui file
‘定义变量
dim i,j,count
‘创建fso对象
set fso=wscript.createobject("scripting.filesystemobject")
‘打开并读取文本a.txt文件内容,将每一行的内容赋值给数组arrayA
Set op=fso.OpenTextFile("d:\a.txt",1,True)
If Not op.AtEndOfStream Then arrayA = Split(op.ReadAll, vbCrLf)
op.close
‘打开并读取文本b.txt文件内容,将每一行的内容赋值给数组arrayB
Set op=fso.OpenTextFile("d:\b.txt",1,True)
If Not op.AtEndOfStream Then arrayB = Split(op.ReadAll, vbCrLf)
op.close
‘比较两个数组,将相同的行输出
for i = lbound(arrayA) to ubound(arrayA)
count = 0
for j = lbound(arrayB) to ubound(arrayB)
if arrayB(j)=arrayA(i) then count = count+1
next
if count >0 then Msgbox(arrayA(i))
next
wscript.quit
标签:os ar for sp 文件 ad bs ui file
原文地址:http://www.cnblogs.com/itwuya/p/4043538.html