CSharp examples for System.Windows.Forms:Dialog
Try Folder Path with FolderBrowserDialog
using System.Windows.Forms; using System.Windows; using System.Linq; using System.Collections.Generic; public class Main{ public static bool TryFolderPath(string description, out string folderPath) {/*from w w w . java 2s. co m*/ var folderSelector = new FolderBrowserDialog() { Description = description }; if (folderSelector.ShowDialog() == DialogResult.OK) { folderPath = folderSelector.SelectedPath; return true; } else { folderPath = string.Empty; return false; } } }