原始碼:http://down.gogobox.com.tw/t2329175/rq2m2
可將需要的檔案加入資源檔(VB6增益功能),然後使用 Open 程序匯出至系統目錄。
這是輸出系統DLL的範例。
轉至 wfire 大大的文。
Ex:

Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long

Private Sub Form_Load()
    Dim TempBinary() As Byte
    If Dir(SysDir & "IJL15.DLL") = "" Then '
        TempBinary = LoadResData(101, "CUSTOM")
        Open SysDir & "IJL15.DLL" For Binary As #1
        Put #1, , TempBinary
        Close #1
    End If
    Erase TempBinary
End Sub

Private Function SysDir() As String
    SysDir = String(255, 0)
    Call GetSystemDirectory(SysDir, 255)
    SysDir = left(SysDir, InStr(SysDir, Chr(0)) - 1) & "\"
End Function
==================================================
'我寫的例子:
Private Sub Command1_Click()
TempBinary = LoadResData(101, "CUSTOM")
Open App.Path & "\damody.jpg" For Binary As #1
        Put #1, , TempBinary
Close #1
Shell "explorer.exe " & App.Path, vbNormalFocus
End Sub
'執行後會在原目錄多一個"damody.jpg"
'並開始原目錄資料夾。


arrow
arrow
    全站熱搜

    讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣()