读取2个二进制文本文件,把内容显示在LISTBOX上。要求把不同的内容所在位置和2个文件的内容显示。
例如:  所在位置     第一个文件内容      第二个文件内容
         10             01            03
        ..             ..            .. 
        ..             ..            ..

解决方案 »

  1.   

    装个Beyond Compare,文件比较很方便。
      

  2.   


    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不知道是不是你期望的答案,你比较来干嘛?
      

  3.   

    ....又是N天前的帖子发现CSDN现在不结帖的越来越多了.