Private Sub Command1_Click() Dim a() As Byte Dim b() As Byte Dim max As Long ReDim a(FileLen("c:\1.exe") - 1) ReDim b(FileLen("c:\2.exe") - 1) Open "c:\1.exe" For Binary As #1 Open "c:\2.exe" For Binary As #2 Get #1, , a Get #2, , b Close #1 Close #2 If FileLen("c:\1.exe") > FileLen("c:\2.exe") Then max = FileLen("c:\2.exe") - 1 Else max = FileLen("c:\1.exe") - 1 End If For z = 0 To max DoEvents If a(z) = b(z) Then MsgBox "第" & z & "个位置数据相同" Else MsgBox "第" & z & "个位置数据不同" End If Next z End Sub不知道是不是你期望的答案,你比较来干嘛?
Private Sub Command1_Click()
Dim a() As Byte
Dim b() As Byte
Dim max As Long
ReDim a(FileLen("c:\1.exe") - 1)
ReDim b(FileLen("c:\2.exe") - 1)
Open "c:\1.exe" For Binary As #1
Open "c:\2.exe" For Binary As #2
Get #1, , a
Get #2, , b
Close #1
Close #2
If FileLen("c:\1.exe") > FileLen("c:\2.exe") Then
max = FileLen("c:\2.exe") - 1
Else
max = FileLen("c:\1.exe") - 1
End If
For z = 0 To max
DoEvents
If a(z) = b(z) Then
MsgBox "第" & z & "个位置数据相同"
Else
MsgBox "第" & z & "个位置数据不同"
End If
Next z
End Sub不知道是不是你期望的答案,你比较来干嘛?