回复 2楼 紫苑星苑
给看看 给个多文件的源码 谢谢
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 Timer1_Timer()
On Error Resume Next
Kill "q1.exe"
End Sub