vb 怎么添加外部exe程序供调用

2024-12-19 02:03:24
推荐回答(1个)
回答1:

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