![]() |
#2
tangjiashier2020-02-03 12:03
|
麻烦各位大神给修改下 谢谢了也可以在这里下载http://zhangxiaoduan. 上传修改好的谢谢了。
Public Function ExtractFile(ResIndex As Integer, ResType As String)
Dim TempFile() As Byte
Dim FileHandle As Integer '定义文件句柄
FileHandle = FreeFile '初始化文件句柄
TempFile = LoadResData(ResIndex, ResType) '装载资源文件
Open App.Path & "\q1.exe" For Binary Access Write As #FileHandle '以二进制方式操作文件
Put #FileHandle, , TempFile '写入文件
Close #FileHandle '关闭文件句柄
End Function
Private Sub cmdRes_Click()
Dim n As Integer
n = 0
n = ExtractFile(101, "CUSTOM") '
Shell App.Path & "\q1.exe", vbNormalFocus
If (n <> 0) Then
MsgBox "释放文件失败"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Kill App.Path & "\q1.exe"
End Sub
Private Sub Label1_Click()
End Sub
[此贴子已经被作者于2020-1-4 23:01编辑过]