Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an OpenFileOrFolderDialog object in .NET?

Is it possible to use the OpenFileDialog class select a file OR folder? It appears only to allow the selection of a file, if you select a folder and then choose open it will navigate to that folder.

If the OpenFileDialog can not be used for this is there another object I should be using?

EDIT: The scenario is that I have a tool that can upload one...many files or folders. I need to be able to provide a dialog like the OpenFileDialog that allows a user to select a file, folder, or a combination of. I know about the FolderBrowseDialog and that is not the answer in this case.

like image 441
Eric Schoonover Avatar asked Sep 19 '08 07:09

Eric Schoonover


2 Answers

This is the solution I have been looking for, this article provides code and describes how to create a dialog that meets my needs.

CodeProject: Full Implementation of IShellBrowser

like image 135
Eric Schoonover Avatar answered Oct 01 '22 06:10

Eric Schoonover


Yes, you can use OpenFileDialog to select a folder. Here is an article in CodeProject that demonstrated a way to do it (http://www.codeproject.com/KB/dialog/OpenFileOrFolderDialog.aspx).

like image 21
stankovski Avatar answered Oct 01 '22 04:10

stankovski