vb 怎么添加外部exe程序供调用
用资源编辑器添加完exe程序后要如何编写?点击按钮生成临时exe程序并调用,关闭时自动删除临时exe程序!...
用资源编辑器添加完exe程序后要如何编写?点击按钮生成临时exe程序并调用,关闭时自动删除临时exe程序!
展开
1个回答
2013-08-10
展开全部
Private Sub Form_Load()
Open App.Path & "\Temp.exe" For Binary As #1
Dim i() As Byte
i = LoadResData(101, "CUSTOM") '101是资源号
Put #1, , i
Close #1
Shell App.Path & "\Temp.exe" '运行程序
End Sub
Private Sub Form_Unload(Cancel As Integer)
Kill App.Path & "\Temp.exe" '删除程序
End Sub
Open App.Path & "\Temp.exe" For Binary As #1
Dim i() As Byte
i = LoadResData(101, "CUSTOM") '101是资源号
Put #1, , i
Close #1
Shell App.Path & "\Temp.exe" '运行程序
End Sub
Private Sub Form_Unload(Cancel As Integer)
Kill App.Path & "\Temp.exe" '删除程序
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询