Share via


IShellDispatch.Explore 方法

在 Windows 檔案總管視窗中開啟指定的資料夾。

語法

IShellDispatch.Explore(
  vDir
)

IShellDispatch.Explore( _
  ByVal vDir As Variant _
)

參數

vDir [in]

類型: Variant

要顯示的資料夾。 這可以是指定資料夾路徑或其中一個 ShellSpecialFolderConstants 值的字串。 請注意, 在 ShellSpecialFolderConstants 中找到的常數名稱可在 Visual Basic 中使用,但不適用於 VBScript 或 JScript。 在這些情況下,數值必須用於其位置。

傳回值

JScript

這個方法不會傳回值。

VB

這個方法不會傳回值。

備註

此方法是透過 Shell.Explore 方法實作和存取。

範例

下列範例示範如何在 JScript、VBScript 和 Visual Basic 中使用 探索

Jscript:

<script language="JScript">
    function fnShellExploreJ()
    {
        var objShell = new ActiveXObject("shell.application");
        
        objshell.Explore("C:\\");
    }
</script>

VBScript:

<script language="VBScript">
    function fnShellExploreVB()
        dim objShell
        dim ssfWINDOWS
        ssfWINDOWS = 36

        set objShell = CreateObject("shell.application")
        objshell.Explore(ssfWINDOWS)

        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnShellExploreVB()
    Dim objShell As Shell

    Set objShell = New Shell
    objshell.Explore (ssfPERSONAL)

    Set objShell = Nothing
End Sub

規格需求

需求
最低支援的用戶端
Windows 2000 Professional、Windows XP [僅限桌面應用程式]
最低支援的伺服器
Windows 2000 Server [僅限桌面應用程式]
標頭
Shldisp.h
Idl
Shldisp.idl
DLL
Shell32.dll (4.71 版或更新版本)