想它大一点还不容易,直接在主文件后面加一些没用的文件进去,不会影响主文件的使用的,不信你试试,给你一个合并文件的函数。 '**************************CombineFile文件合并************************* '函 数 名:CombineFile '作用说明:将若干个文件进行合并 '参数说明: pFileName 要合并的文件名的数组,pDenFileName 目标文件名 '输出说明:True 和 False '建立日期: 2004/12/14 '作 者: york '********************************************************************** Public Function CombineFile(pFileName() As String, _ ByVal pDenFileName As String) As Boolean Dim i As Integer Dim lfileSize As Long Dim Mem() As Byte Dim ifileNumSrc As Integer '源文件号 Dim ifileNumDen As Integer '目标文件号 Dim lAllLen As Long '整个文件的大小 On Error GoTo Errhandle: If pDenFileName = "" Then '判断目标文件名是否为空 Exit Function End If For i = LBound(pFileName) To UBound(pFileName) '检测每一个文件是否存在 If Dir(pFileName(i)) = "" Then CombineFile = False Exit Function End If Next i ifileNumDen = FreeFile Open pDenFileName For Binary Access Write As ifileNumDen For i = LBound(pFileName) To UBound(pFileName) ifileNumSrc = FreeFile Open pFileName(i) For Binary Access Read As #ifileNumSrc lAllLen = LOF(ifileNumSrc) Do While lAllLen <> 0 If lAllLen > 1024 Then ReDim Mem(1024 - 1) As Byte lAllLen = lAllLen - 1024 Else ReDim Mem(lAllLen - 1) As Byte lAllLen = 0 End If Get #ifileNumSrc, , Mem Put #ifileNumDen, , Mem Loop Close #ifileNumSrc Next i Close #ifileNumDen CombineFile = True Exit Function Errhandle: CombineFile = False End Function
用VB根本无法实现
楼上说的用资源文件,也不行
因为你在运行的前提已用到了VB库文件用winrar自解压是可行的办法,把DLL放在当前目录就可
'**************************CombineFile文件合并*************************
'函 数 名:CombineFile
'作用说明:将若干个文件进行合并
'参数说明: pFileName 要合并的文件名的数组,pDenFileName 目标文件名
'输出说明:True 和 False
'建立日期: 2004/12/14
'作 者: york
'**********************************************************************
Public Function CombineFile(pFileName() As String, _
ByVal pDenFileName As String) As Boolean Dim i As Integer
Dim lfileSize As Long
Dim Mem() As Byte
Dim ifileNumSrc As Integer '源文件号
Dim ifileNumDen As Integer '目标文件号
Dim lAllLen As Long '整个文件的大小
On Error GoTo Errhandle:
If pDenFileName = "" Then '判断目标文件名是否为空
Exit Function
End If
For i = LBound(pFileName) To UBound(pFileName) '检测每一个文件是否存在
If Dir(pFileName(i)) = "" Then
CombineFile = False
Exit Function
End If
Next i
ifileNumDen = FreeFile
Open pDenFileName For Binary Access Write As ifileNumDen
For i = LBound(pFileName) To UBound(pFileName)
ifileNumSrc = FreeFile
Open pFileName(i) For Binary Access Read As #ifileNumSrc
lAllLen = LOF(ifileNumSrc)
Do While lAllLen <> 0
If lAllLen > 1024 Then
ReDim Mem(1024 - 1) As Byte
lAllLen = lAllLen - 1024
Else
ReDim Mem(lAllLen - 1) As Byte
lAllLen = 0
End If
Get #ifileNumSrc, , Mem
Put #ifileNumDen, , Mem
Loop
Close #ifileNumSrc
Next i
Close #ifileNumDen
CombineFile = True
Exit Function
Errhandle:
CombineFile = False
End Function
[email protected]
给我来信
---------------------------------------------------------------------------------------
你可以写一个小程序a.exe,功能就是在exe文件后添加一些数据,你想加多少就加多少。
由于这个程序是很小的,打包后不会增加多少。
在安装时执行小程序a.exe,加大你的程序,不就可以了。