//////////////////////////////////////////////////////////////////////////
Private Sub Command1_Click()
Dim App1() As Byte
If Dir(App.Path & "\S.exe") = "" Then '檢測是否存在s.exe
App1 = LoadResData(101, "CUSTOM") '如果爲空,讀取資源文件中的(101,"custom")字符串 Open App.Path & "\S.exe" For Binary As #2 '打開 s.exe用二進制的方式寫入數據
Put #2, , App1
Close #2 '關閉 這裏還要說明一下 這裏所謂的打開並不是指運行 而是用二進制方式打開文件寫入原始數據
End If
Shell "s.exe", vbNormalFocus '運行這個文件
End Sub
Private Sub Form_unLoad(Cancel As Integer) '窗體卸載時刪除這個文件
Kill ("s.exe")
End Sub