Question : c# windows forms choose directory
Answered by : blushing-bat-zwy1tpljiv6j
using(var fbd = new FolderBrowserDialog())
{ DialogResult result = fbd.ShowDialog(); if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath)) { string[] files = Directory.GetFiles(fbd.SelectedPath); System.Windows.Forms.MessageBox.Show("Files found: " + files.Length.ToString(), "Message"); }
}
Source : https://stackoverflow.com/questions/11624298/how-to-use-openfiledialog-to-select-a-folder | Last Update : Mon, 28 Sep 20