操作說明:將自訂位置加入至檔案對話方塊

Windows Vista 上預設開啟並儲存對話方塊的區域位於標題為 [我的最愛連結 ] 對話方塊的左側。 這個區域稱為自訂位置。 OpenFileDialogSaveFileDialog 類別可讓您將資料夾新增至 CustomPlaces 集合。

注意

為了讓自訂位置出現在 或 SaveFileDialogOpenFileDialogAutoUpgradeEnabled 屬性必須設定為 true (預設值)。

將自訂位置新增至檔案對話方塊

  • 將路徑、已知資料夾 GUID 或 FileDialogCustomPlace 物件新增至 CustomPlaces 對話方塊的集合。

    下列程式碼範例示範如何新增路徑:

    OpenFileDialog1.CustomPlaces.Add("C:\MyCustomPlace")  
    
    openFileDialog1.CustomPlaces.Add("C:\\MyCustomPlace");  
    

另請參閱