比较两个文件
有一种朋友不在生活里,却在生命力;有一种陪伴不在身边,却在心间。图老师即在大家的生活中又在身边。这么贴心的服务你感受到了吗?话不多说下面就和大家分享比较两个文件吧。
Dimissameasboolean
OpenF1ForBinaryAs#1
OpenF2ForBinaryAs#2
issame=True
IfLOF(1)LOF(2)Then
issame=False
Else
whole&=LOF(1)10000'numberofwhole10,000bytechunks
part&=LOF(1)Mod10000'remainingbytesatendoffile
buffer1$=String$(10000,0)
buffer2$=String$(10000,0)
start&=1
Forx&=1Towhole&'thisfor-nextloopwillget10,000
Get#1,start&,buffer1$'bytechunksatatime.
Get#2,start&,buffer2$
Ifbuffer1$buffer2$Then
issame=False
ExitFor
EndIf
start&=start& 10000
Next
buffer1$=String$(part&,0)
buffer2$=String$(part&,0)
Get#1,start&,buffer1$'gettheremainingbytesattheend
Get#2,start&,buffer2$'gettheremainingbytesattheend
Ifbuffer1$buffer2$Then
issame=False
EndIf
Close
CompFile=issame
EndFunction->