PathHelper,获取当前执行程序的叔叔文件夹
System.Console.WriteLine(PathHelper.GetExeCurDir());
System.Console.WriteLine(PathHelper.GetExeGrandFatherDir());
System.Console.WriteLine(PathHelper.GetExeUncleDir("Files"));
System.Console.WriteLine(PathHelper.GetExeUncleDir("Files\\TouchDownTestResultFolder"));
using System.Reflection;
public static class PathHelper
{
public static string GetExeCurDir()
{
string exeDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
return exeDir;
}
public static string GetExeGrandFatherDir()
{
return Path.GetDirectoryName(PathHelper.GetExeCurDir())!;
}
public static string GetExeUncleDir(string uncleFolerName)
{
return Path.Combine(PathHelper.GetExeGrandFatherDir(), uncleFolerName);
}
}