See the OpenFileDialog::Multiselect property, from the docs:
Gets or sets a value indicating whether the dialog box allows multiple files to be selected.
To get the list of files selected you should use the OpenFileDialog::FileNames property.
Adding style OFN_ALLOWMULTISELECT, see this Article Multiple File Selection Without Any Extra Code
CodeProject Article: SelectDialog - A Multiple File and Folder Select Dialog
ADDED: See this added sample code for Multiple Files Selection in C#:
OpenFileDialog d = new OpenFileDialog();
d.Filter = "All files|*.*";
d.Multiselect = true;
if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
foreach (string fileName in d.FileNames)
{
// ... do something ...
}
}
For Multiple Folder selection,
You can use TreeView control by populating it with the Directory structure using the below reference:
Populate TreeView with file system directory structure
Secondly, you can allow multiple selection using SelectedNodes of TreeView Control to select multiple folders.
C# TreeView with multiple selection
FolderBrowserDialog Control
Hope this will help you!