Ответ 1
upDir = Directory.GetParent(path).FullName;
Как получить родительский каталог, например:
string upDir = GetOneLvlUp(@"C:\AAA\BBB\CCC\DDD\");
Output: C:\AAA\BBB\CCC\
upDir = Directory.GetParent(path).FullName;
Все, что вы хотите, находится в классе Directory:
http://msdn.microsoft.com/en-us/library/system.io.directory.aspx
В частности, GetParent:
http://msdn.microsoft.com/en-us/library/system.io.directory.getparent.aspx
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string parentDir = Directory.GetParent(path).FullName;
var upDir = new DirectoryInfo(yourPath).Parent.FullName;