C#-取目录的父路径

string appPath=Path.GetDirectoryName("文件路径") ;  // 获取文档的目录
string str1=Directory.GetParent(appPath).FullName;  // 目录的父
string str2=Directory.GetParent(appPath).Parent.FullName;  // 目录的父的父
posted @ 2023-04-14 11:10  ꧁执笔小白꧂  阅读(236)  评论(0)    收藏  举报