Answers for "how to get directory name in c#"

C#
2

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
1

c# get directory name from filename

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

Code answers related to "how to get directory name in c#"

C# Answers by Framework

Browse Popular Code Answers by Language