C# 获取当前目录上一级目录

 

string path="D:\AA\BB\CC";

Directory.SetCurrentDirectory(Directory.GetParent(path).FullName);

path = Directory.GetCurrentDirectory();

// path:"D:\AA\BB"

 

你可能感兴趣的:(C# 获取当前目录上一级目录)