//使用appdomain获取当前应用程序集的执行目录
string dir = AppDomain.CurrentDomain.BaseDirectory;
//使用path获取当前应用程序集的执行的上级目录
dir = Path.GetFullPath("..");
//使用path获取当前应用程序集的执行目录的上级的上级目录
dir = Path.GetFullPath("../..");

 

 

其他的获取根目录路径方法可以参考博文 http://www.cnblogs.com/ching2009/p/4293597.html

相关文章:

  • 2021-06-26
  • 2022-12-23
  • 2021-07-01
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-21
  • 2021-12-13
  • 2021-07-11
  • 2022-02-10
  • 2021-11-18
相关资源
相似解决方案