我如何获得一个目录的父,例如:你想如何找到路径的父目录?
string upDir = GetOneLvlUp(@"C:\AAA\BBB\CCC\DDD\");
Output: C:\AAA\BBB\CCC\
我如何获得一个目录的父,例如:你想如何找到路径的父目录?
string upDir = GetOneLvlUp(@"C:\AAA\BBB\CCC\DDD\");
Output: C:\AAA\BBB\CCC\
upDir = Directory.GetParent(path).FullName;
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string parentDir = Directory.GetParent(path).FullName;
可能的重复[如何在C#中找到父目录?](http://stackoverflow.com/questions/6875904/how-do-i-find-the-parent-directory-in-c) – bfavaretto 2012-07-10 00:44:43