查看完整版本: 請問如何用vb開啟資料夾

sum110104 2006-6-12 03:00 PM

請問如何用vb開啟資料夾

[b]請問如何用vb開啟資料夾,我想做一個整理檔案用的程式,可是shell函數好像只能開執行檔,還是我不會用,請知道的大大幫忙,我想知道如何用vb來開起資料夾,謝謝![/b]

Waroger 2006-6-12 06:59 PM

用API吧
[code]Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
        ShellExecute Me.hwnd, "", "C:\Documents and Settings\", "", "", 3
End Sub
'或是
Private Sub Command2_Click()
        Shell "explorer.exe C:\Documents and Settings\", 3
End Sub[/code]

[[i] 本帖最後由 Waroger 於 2006-6-12 07:03 PM 編輯 [/i]]
頁: [1]
查看完整版本: 請問如何用vb開啟資料夾