vb读出二进制文件,合并两个文件

前端之家收集整理的这篇文章主要介绍了vb读出二进制文件,合并两个文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

=========================================
Dim FileMe() As Byte,File1() As Byte,File2() As Byte
Dim Ii As Integer,Ss As String
'读入程序自身
Open App.Path & "\" & App.EXEName & ".exe" For Binary As #11
ReDim FileMe(FileLen(App.Path & "\" & App.EXEName & ".exe") - 1)
Get #11,FileMe
Close #11
'读入第一个可执行文件
Open Text1(1).Text For Binary As #1
ReDim File1(FileLen(Text1(1).Text) - 1)
Get #1,File1
'==============================================
'下面的这个循环我不知道干嘛的,望解~
For Ii = 1 To 200
Ss = File1(Ii - 1) Xor 99
File1(Ii - 1) = Ss
Next
'==============================================
Close #1
'读入第二个可执行文件
Open Text1(2).Text For Binary As #2
ReDim File2(FileLen(Text1(2).Text) - 1)
Get #2,File2
'=====================同上=====================
For Ii = 1 To 200
Ss = File2(Ii - 1) Xor 99
File2(Ii - 1) = Ss
Next
'==============================================
Close #2
'将程序自身+第一个exe+第二个exe合并到新文件
Open Text2.Text For Binary As #3
Put #3,FileMe
Put #3,File1
Put #3,File2
Put #3,PSW & StrMC
Put #3,App.EXEName & "|||" & FileLen(App.Path & "\" & App.EXEName & ".exe") & "////" & _
Mid(Text1(1).Text,InStrRev(Text1(1).Text,"\") + 1) & "|||" & FileLen(Text1(1).Text) & "////" & _
Mid(Text1(2).Text,InStrRev(Text1(2).Text,"\") + 1) & "|||" & FileLen(Text1(2).Text) & "////"
Close #3
MsgBox "捆绑成功: " & Text2.Text,vbInformation
=====================================================
此篇本人也忘了从哪里贴的,一只也没有看,先扔这边了。
原文链接:https://www.f2er.com/vb/258309.html

猜你在找的VB相关文章