📜  获取路径的目录名 c# Code Example

📅  最后修改于: 2022-03-11 14:49:12.084000             🧑  作者: Mango

代码示例1
string filename = @"C:/folder1/folder2/file.txt";
string FolderName = new DirectoryInfo(System.IO.Path.GetDirectoryName(filename)).Name;