程序代码 打开VB 资源编辑器,新建,点击”添加自定义资源”,浏览我需要引入的EXE文件,然后修改属性,类型改为”EXE”, 包括引号哦,标识号为默认,只要不重复就行了。然后就是写代码,添个按钮功能是:点击后他会将我引入的exe文件, 复制到 D盘。可使用相对路径
Private Sub Command1_Click()
Dim TempFile() As Byte
Dim intFile As Long
TempFile = LoadResData(101, "EXE")
intFile = FreeFile()
Open "D:\myrdp.exe" For Binary Access Write As #intFile
Put #intFile, , TempFile
Close #intFile
End Sub
//以下是示例
Private Sub Command1_Click()
Dim TempFile() As Byte
Dim intFile As Long
TempFile = LoadResData(101, "EXE")
intFile = FreeFile()
Open App.Path & "\句柄检测.exe" For Binary Access Write As #intFile
Put #intFile, , TempFile
Close #intFile
End Sub
Private Sub Command2_Click()
Shell App.Path & "\句柄检测.exe"
Shell App.Path & "\测试.exe"
End Sub
示例:
EXE文件包含进VB中