CSharp examples for System.IO:DirectoryInfo
Dialog to Ask Directory Path
using System.Windows.Forms; using System.Text; using System.Collections.Generic; using System;//from w ww .ja v a 2 s . c o m public class Main{ public static string AskDirectoryPath(string InitialDirectory = "") { FolderBrowserDialog fd = new FolderBrowserDialog(); fd.ShowNewFolderButton = true; if (InitialDirectory != "") fd.SelectedPath = InitialDirectory; if (fd.ShowDialog() == DialogResult.OK) return fd.SelectedPath; else return InitialDirectory; } }