OpenFileDialog - many files

  • Thread starter Thread starter Piotrek Stachowicz
  • Start date Start date
P

Piotrek Stachowicz

Hi,
Is there any way how can I select more than 1 file in the
OpenFileDialog?! It would be really greate if I could also select a
directory, click open, and recevice all the files in that directory in my
application.

Piotrek
 
Hi Piotrek,

You can select more than one file if you set the OpenFileDialog.MultiSelect = true.
You can't select a directory and expect it to add all the files within, but you can use CTRL-A to select all the files within the current directory, which is almost as good.
 
Is there any way how can I select more than 1 file in the OpenFileDialog?!

Set the MultiSelect property = true.
It would be really greate if I could also select a directory, click open,
and recevice all the files in that directory in my application.

If you just want your users to select a directory and then have your app do
something with all the files in that directory without having to display the
directory contents to the user, you could use the BrowseFolder stuff to
select a directory, then reference that folder's contents with the
GetFiles() method in the System.IO namespeace...
 
Back
Top