【问题标题】:How to get the current project directory or the bin directory and move a few level up?如何获取当前项目目录或 bin 目录并向上移动几级?
【发布时间】:2010-05-24 02:13:01
【问题描述】:

我有一个 ASP.Net MVC 应用程序,并且我在 Content 目录中有一些 xsl 文件。 我已经尝试了几种方法来动态获取目录购买不断短缺。

那么如何让目录指向 Content/xsl 文件夹?

我最接近的是这个:

this.GetType().Assembly.CodeBase 

它只返回项目 DLL,但我不知道如何从那里向上移动几个级别或使用什么 .net 库来导航路径。

没有../.. :(

基本上我想导航到与 Bin 目录处于同一级别的 Content/xsl 文件夹。

【问题讨论】:

    标签: c# asp.net directory navigation project-folder


    【解决方案1】:

    您应该为此Server.MapPath

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-26
      • 2016-08-20
      • 1970-01-01
      • 1970-01-01
      • 2012-01-29
      • 1970-01-01
      • 2013-01-29
      相关资源
      最近更新 更多