how to get file directory path in c# code example
Example 1: c# how to get a file path from user
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.Description = "Custom Description";
if (fbd.ShowDialog() == DialogResult.OK)
{
string sSelectedPath = fbd.SelectedPath;
}
Example 2: c# get folder path from file path
Path.GetDirectoryName(filename);
Example 3: get documents path c#
String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);