System.Windows.Forms.FolderBrowserDialog objDialog = new FolderBrowserDialog();
objDialog.Description = "Beschreibung";
objDialog.SelectedPath=@"C:"; // Vorgabe Pfad (und danach der gewählte Pfad)
Alte URL:
/snippet/verzeichnisauswahl-dialog-folderbrowserdialog/840
Sehr nettes Snippet. Es lässt sich jedoch noch etwas kürzer fassen:
[code]if (objDialog.ShowDialog(this) == DialogResult.OK)
MessageBox.Show(„Neuer Pfad: “ + objDialog.SelectedPath);[/code]