Um in C# einen Ordnerauswahldialog zu erstellen, kannst du die FolderBrowserDialog Klasse aus dem System.Windows.Forms Namespace verwenden.
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
// Set the initial directory (optional)
folderBrowserDialog.SelectedPath = @"C:\";
// Show the dialog and check if the user selected a folder
DialogResult result = folderBrowserDialog.ShowDialog();
if (result == DialogResult.OK)
{
// Retrieve the selected folder
string selectedFolder = folderBrowserDialog.SelectedPath;
Console.WriteLine("Selected folder: " + selectedFolder);
}
else
{
Console.WriteLine("Folder selection cancelled.");
}