Archive for the 'winforms' Category

07
Jun
09

c# selecting a directory in an “open file” dialog


If you need to select a directory in an “open file” dialog, you can use the following code :


FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.ShowDialog();
string selected = dialog.SelectedPath;

The window will look like this :
dialog




Blog Stats

  • 223,713 hits