over 4 years ago
using System.Windows.Forms;

FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.Description = "Select Color Image folder";
DialogResult result = fbd.ShowDialog();
if (result.ToString() != "OK")
    return;
selectImagePath = fbd.SelectedPath; 
List<string> colorlist = new List<string>();
// use Directory.GetFiles to get the list of files in selected folder.
colorlist = Directory.GetFiles(selectImagePath, "*.jpg").ToList();

We can use the code above to get the selected folder path.

← [C#] select file by using file dialog [C++] split string into vector →