VB生成另一个EXE文件

来源:百度知道 编辑:UC知道 时间:2024/07/04 18:33:52
已经有个a.exe文件 我想编一个b.exe程序 让b.exe文件生成a.exe文件(不知道我说清楚了没)
请问如何实现 谢谢
请务必做详细的注释 谢谢了

外接程序--外接程序管理器--VB6 资源管理器--选择加载
在工具栏中 绿色图标(VB 资源管理器) 点击~ 对话框中 问号左边第一个
添加自定义资源 选择 a.exe文件加入其中
在B窗体代码中
Dim fname As String
Private Sub command1_click()
Dim v
Dim byt() As Byte
fname = "z:\test.exe"
If Dir(fname) = "" Then
v = LoadResData(101, "CUSTOM")
byt = v
Open fname For Binary As #1
Put #1, 1, byt()
Close #1
End If
End Sub

把a.exe添加到自定义资源,. 代码部分写:(很详细的注释)

Private Sub Command1_Click()
Dim APP1() As Byte '定义变量
If Dir(App.Path & "\a.exe") = "" Then '如果当前目录没有a.exe文件
'将a.exe数据载入变量
APP1 = LoadResData(101, "CUSTOM")
Open App.Path & "\a.exe" For Binary As #2
Put #2, , APP1 '将变量的数据写入a.exe
Close #2
End If
End Sub

把a.exe添加到自定义资源,. 代码部分写:(很详细的注释)

Private Sub Command1_Click()
Dim APP1() As Byte '定义变量
If Dir(App.Pa