Answers for "c# get folder path from file path"

0

get directory name of path c#

string filename = @"C:/folder1/folder2/file.txt";
string FolderName = new DirectoryInfo(System.IO.Path.GetDirectoryName(filename)).Name;
Posted by: Guest on January-01-2021
0

get documents path c#

String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
Posted by: Guest on February-26-2021
0

c# get folder path from file path

Path.GetDirectoryName(filename);
Posted by: Guest on June-02-2021
0

c# how to get a file path from user

OpenFileDialog choofdlog = new OpenFileDialog();
choofdlog.Filter = "All Files (*.*)|*.*";
choofdlog.FilterIndex = 1;
choofdlog.Multiselect = true;

if (choofdlog.ShowDialog() == DialogResult.OK)    
{     
    string sFileName = choofdlog.FileName; 
    string[] arrAllFiles = choofdlog.FileNames; //used when Multiselect = true           
}
Posted by: Guest on May-31-2020
-2

c# get folder of full ilepath

string fileName = @"test.txt";
    string currentDirectory = Directory.GetCurrentDirectory();
    string[] fullFilePath = Directory.GetFiles(currentDirectory, filename, SearchOption.AllDirectories);
Posted by: Guest on September-08-2020

Code answers related to "c# get folder path from file path"

Browse Popular Code Answers by Language