首页
社区
课程
招聘
[旧帖] [求助]一个程序被修改过 0.00雪花
发表于: 2010-8-22 19:57 5368

[旧帖] [求助]一个程序被修改过 0.00雪花

2010-8-22 19:57
5368
一个程序被修改过
要什么知道那个地方别修改过   (原程序还在)

需什么对比

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (10)
雪    币: 375
活跃值: (12)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
2
UltraCompare
2010-8-22 20:39
0
雪    币: 403
活跃值: (16)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
WinHex有对比文件的功能。
2010-8-22 20:43
0
雪    币: 500
活跃值: (11)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
4
cmd

fc /b a.exe b.exe
2010-8-24 07:16
0
雪    币: 47147
活跃值: (20380)
能力值: (RANK:350 )
在线值:
发帖
回帖
粉丝
5
除了楼上的几款,还有其他的,如Beyond Compare等
2010-8-24 09:24
0
雪    币: 468
活跃值: (52)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
fc /b file1 file2
等拿分。
2010-8-24 09:32
0
雪    币: 58
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
强烈推荐 Beyond Compare, 可按照 Binary/二进制 进行比较,方便实用。
2010-8-24 20:56
0
雪    币: 1
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
asdasssssssssssssssssssssssssssssssss
2010-8-25 21:35
0
雪    币: 62
活跃值: (60)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
下面是我收藏的一个VB代码。。还不错。文件比对的一个工具  。。你可以试着自己改哈哈。。控件自己添加进去就OK了。

Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long

Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long

Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long '声明sendmessage函数

Private Declare Sub InitCommonControls Lib "comctl32.dll" ()

Const LB_SETHORIZONTALEXTENT = &H194

Public apppath As String

Dim ags() As String
Public filepath As String
Private Type OFSTRUCT
cBytes As Byte
fFixedDisk As Byte
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName As String * 128
End Type

Private Sub Form_Initialize()
InitCommonControls
End Sub

Private Sub Command1_Click()
With CommonDialog1
On Error GoTo err_
.CancelError = True
.DialogTitle = "请选择文件..."
.Filter = "所有文件 (*.*)|*.*"
.Flags = &H4
.ShowOpen
End With
Me.Text1.Text = CommonDialog1.FileName
err_:
End Sub

Private Sub Command2_Click()
With CommonDialog2
On Error GoTo err_
.CancelError = True
.DialogTitle = "请选择文件..."
.Filter = "所有文件 (*.*)|*.*"
.Flags = &H4
.ShowOpen
End With
Me.Text2.Text = CommonDialog2.FileName
err_:
End Sub

Private Sub Command3_Click()
If List1.ListCount = 0 Then
MsgBox "没有相同的文件列表", , "提示"
Exit Sub
End If
With CommonDialog1
On Error GoTo err_
.CancelError = True
.DialogTitle = "请选择文件..."
.Filter = "所有文件 (*.*)|*.*"
.Flags = &H4
.ShowOpen
End With
Open CommonDialog1.FileName For Output As #3
Dim i As Integer

For i = 0 To List1.ListCount
Print #3, List1.List(i)
Next
Close #3
err_:
End Sub

Private Sub Command4_Click()
If List2.ListCount = 0 Then
MsgBox "没有不同的文件列表", , "提示"
Exit Sub
End If
With CommonDialog2
On Error GoTo err_
.CancelError = True
.DialogTitle = "请选择文件..."
.Filter = "所有文件 (*.*)|*.*"
.Flags = &H4
.ShowOpen
End With
Open CommonDialog2.FileName For Output As #4
Dim i As Integer
For i = 0 To List2.ListCount
Print #4, List2.List(i)
Next
Close #4
err_:
End Sub

Private Sub Command5_Click()

If Me.Text1.Text = "" Or Me.Text1.Text = "请输入文件一" Then
MsgBox "请输入文件 1或者" & vbNewLine & "浏览选择一个文件", , "提示"
Me.Text1.SetFocus
Exit Sub
End If
If Me.Text2.Text = "" Or Me.Text2.Text = "请输入文件二" Then
MsgBox "请输入文件 2或者" & vbNewLine & "浏览选择一个文件", , "提示"
Me.Text2.SetFocus
Exit Sub
End If
If Me.Text1.Text = Me.Text2.Text Then
MsgBox "对比文件是同一个文件" & vbNewLine & "请选择另外一个文件!!!", , "提示"
Me.Text2.SetFocus
Exit Sub
End If

If Me.Option1 = True Then
Call fc_a
Else
Call fc_b
End If
End Sub

Private Sub Command6_Click()
Unload Me
End
End Sub

Private Sub Form_Load()
If Command <> "" Then
Me.Hide
End If
If Right(App.Path, 1) <> "\" Then apppath = App.Path & "\"
ags = Split(Command, " ")
Dim i As Integer
On Error Resume Next
If InStr(ags(0), "/") <> 0 Then
ags(0) = Replace(ags(0), "/", "")
End If
If Command() <> "" Then
If Dir(ags(0)) = "" Then
End
End If
End If
If InStr(ags(1), "/") <> 0 Then
ags(1) = Replace(ags(1), "/", "")
End If
If Command() <> "" Then
If Dir(ags(1)) = "" Then
End
End If
End If
If Command <> "" And UBound(ags) < 2 Then End
Dim flag As Integer
flag = 0
For i = 2 To UBound(ags)
If InStr(ags(i), "/") <> 0 Then
ags(i) = Replace(ags(i), "/", "")
End If
If InStr(ags(i), "-") <> 0 Then
ags(i) = Replace(ags(i), "-", "")
End If
If LCase(ags(i)) = "a" Then
flag = 1
Else
flag = 0
End If
Next
If Command <> "" And flag = 1 Then
Call fccmd
Else
Call fccmd_
End If
End Sub

Private Sub Text1_GotFocus()
On Error Resume Next
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub

Private Sub Text2_GotFocus()
On Error Resume Next
Text2.SelStart = 0
Text2.SelLength = Len(Text1.Text)
End Sub

Private Sub lb()
Me.ScaleMode = vbPixels
Dim max As Integer, max_ As Integer
With List1
For max_ = 0 To .ListCount - 1
If Me.TextWidth(.List(max_)) > max Then
max = Me.TextWidth(.List(max_)) + 5
End If
Next
End With

If max > 232 Then
SendMessage List1.hwnd, LB_SETHORIZONTALEXTENT, max, ByVal 0&
End If
End Sub

Private Sub lb_()
Me.ScaleMode = vbPixels
Dim max As Integer, max_ As Integer
With List2
For max_ = 0 To .ListCount - 1
If Me.TextWidth(.List(max_)) > max Then
max = Me.TextWidth(.List(max_)) + 5
End If
Next
End With

If max > 232 Then
SendMessage List2.hwnd, LB_SETHORIZONTALEXTENT, max, ByVal 0&
End If
End Sub

Private Sub fc_a()

Dim fcstring As String
Dim fcstring_ As String
Dim hFile As Long, lenFile As Long, OF As OFSTRUCT, hfile_ As Long, ret As Long, ret_ As Long
hFile = OpenFile(Me.Text1.Text, OF, OF_READ)
hfile_ = OpenFile(Me.Text2.Text, OF, OF_READ)
ret = GetFileSize(hFile, 0)
ret_ = GetFileSize(hfile_, 0)
If ret = ret_ Then
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
Else
List2.AddItem Me.Text1.Text
Call lb_
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
Exit Sub
End If

Open Me.Text1.Text For Input As #1
Open Me.Text2.Text For Input As #2
Do While (1)
DoEvents
If Not EOF(1) And EOF(2) Then
List2.AddItem Me.Text1.Text
Call lb_
Close #1
Close #2
Exit Sub
End If
If Not EOF(2) And EOF(1) Then
List2.AddItem Me.Text1.Text
Call lb_
Close #1
Close #2
Exit Sub
End If
Input #1, fcstring
Input #2, fcstring_
If fcstring = fcstring_ Then
If EOF(1) And EOF(2) Then
List1.AddItem Me.Text1.Text
Call lb
Close #1
Close #2
Exit Sub
End If
End If
If fcstring <> fcstring_ Then
List2.AddItem Me.Text1.Text
Call lb_
Close #1
Close #2
Exit Sub
End If
Loop
Close #1
Close #2
End Sub

Private Sub fc_b()
Dim Filestring As Byte
Dim Filestring_ As Byte
Dim hFile As Long, lenFile As Long, OF As OFSTRUCT, hfile_ As Long, ret As Long, ret_ As Long
hFile = OpenFile(Me.Text1.Text, OF, OF_READ)
hfile_ = OpenFile(Me.Text2.Text, OF, OF_READ)
ret = GetFileSize(hFile, 0)
ret_ = GetFileSize(hfile_, 0)
If ret = ret_ Then
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
Else
List2.AddItem Me.Text1.Text
Call lb_
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
Exit Sub
End If
Open Me.Text1.Text For Binary As #1
Open Me.Text2.Text For Binary As #2
Do While (1)
DoEvents
If Not EOF(1) And EOF(2) Then
List2.AddItem Me.Text1.Text
Call lb_
Close #1
Close #2
Exit Sub
End If
If Not EOF(2) And EOF(1) Then
List2.AddItem Me.Text1.Text
Call lb_
Close #1
Close #2
Exit Sub
End If
Get #1, , Filestring
Get #2, , Filestring_
If Filestring = Filestring_ Then
If EOF(1) And EOF(2) Then
List1.AddItem Me.Text1.Text
Call lb
Close #1
Close #2
Exit Sub
End If
End If
If Filestring <> Filestring_ Then
List2.AddItem Me.Text1.Text
Call lb_
Close #1
Close #2
Exit Sub
End If
Loop
End Sub

Private Sub fccmd()
Dim fcfile As String
Dim fcfiler As String
Dim fcstring As String
Dim fcstring_ As String
Dim flag As Integer
flag = 1
Dim hFile As Long, lenFile As Long, OF As OFSTRUCT, hfile_ As Long, ret As Long, ret_ As Long
hFile = OpenFile(ags(0), OF, OF_READ)
hfile_ = OpenFile(ags(1), OF, OF_READ)
ret = GetFileSize(hFile, 0)
ret_ = GetFileSize(hfile_, 0)
If ret = ret_ Then
flag = 1
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
Else
flag = 0
fcfile = ags(0)
Call lb_
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
GoTo rr:
End If

Open ags(0) For Input As #1
Open ags(1) For Input As #2
Do While (1)
DoEvents
If Not EOF(1) And EOF(2) Then
fcfile = ags(0)
flag = 0
Close #1
Close #2
Exit Do
End If
If Not EOF(2) And EOF(1) Then
fcfile = ags(0)
flag = 0
Close #1
Close #2
Exit Do
End If
Input #1, fcstring
Input #2, fcstring_
If fcstring = fcstring_ Then
If EOF(1) And EOF(2) Then
flag = 1
fcfiler = ags(0)
Close #1
Close #2
Exit Do
End If
End If
If fcstring <> fcstring_ Then
fcfile = ags(0)
flag = 0
Close #1
Close #2
Exit Do
End If
Loop
Close #1
Close #2

rr:
If flag = 1 Then
Open apppath & "same.txt" For Append As #5
Print #5, fcfiler
Close #5
Else
Open apppath & "different.txt" For Append As #5
Print #5, fcfile
Close #5
End If
End
End Sub

Private Sub fccmd_()
Dim fcfile As String
Dim fcfiler As String
Dim fcstring As Byte
Dim fcstring_ As Byte
Dim flag As Integer
flag = 1
Dim hFile As Long, lenFile As Long, OF As OFSTRUCT, hfile_ As Long, ret As Long, ret_ As Long
hFile = OpenFile(ags(0), OF, OF_READ)
hfile_ = OpenFile(ags(1), OF, OF_READ)
ret = GetFileSize(hFile, 0)
ret_ = GetFileSize(hfile_, 0)
If ret = ret_ Then
flag = 1
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
Else
flag = 0
fcfile = ags(0)
Call lb_
Call CloseHandle(hFile)
Call CloseHandle(hfile_)
GoTo err:
End If

Open ags(0) For Binary As #10
Open ags(1) For Binary As #20
Do While (1)
DoEvents
If Not EOF(10) And EOF(20) Then
fcfile = ags(0)
flag = 0
Close #10
Close #20
Exit Do
End If
If Not EOF(20) And EOF(10) Then
fcfile = ags(0)
flag = 0
Close #10
Close #20
Exit Do
End If

Get #10, , fcstring
Get #20, , fcstring_
If fcstring = fcstring_ Then
If EOF(10) And EOF(20) Then
flag = 1
fcfiler = ags(0)
Close #10
Close #20
Exit Do
End If
End If
If fcstring <> fcstring_ Then
fcfile = ags(0)
flag = 0
Close #10
Close #20
Exit Do
End If
Loop
Close #10
Close #20
err:
If flag = 1 Then
Open apppath & "same.txt" For Append As #50
Print #50, fcfiler
Close #50
Else
Open apppath & "different.txt" For Append As #50
Print #50, fcfile
Close #50
End If
End
End Sub
2010-8-26 01:02
0
雪    币: 2
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
学习了,谢谢楼主!
2010-8-26 08:03
0
雪    币: 1
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
碰到同样的问题 学习了
2010-8-26 09:21
0
游客
登录 | 注册 方可回帖
返回
//