Get folder name ONLY from open file dialog /browse
Hi, I want to get folder / directory path in which I browse to (perhaps using OpenFileDialog()) i.e. for example I want to save the default folder name in which End Users can save their Reports. Thanks - Chagbert.

EhteshamPosted May 22, 2012, 8:42 AM
{
if (Dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string Path = Dialog.FileName;
string FolderName = System.IO.Path.GetDirectoryName(Path);
System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(FolderName);
MessageBox.Show(info.Name);
}
}
Why not FolderBrowserDialog Control?