开发者

How to get the current project directory or the bin directory and move a few level up?

开发者 https://www.devze.com 2022-12-31 03:52 出处:网络
I have an ASP.Net MVC app, and i have some xsl files inside of the Content d开发者_JAVA百科irectory.

I have an ASP.Net MVC app, and i have some xsl files inside of the Content d开发者_JAVA百科irectory. I've try a few methods to get directory dynamically buy keep on coming short.

So how do i get the directory to point to the Content/xsl folder?

the closest that i came to was with this:

this.GetType().Assembly.CodeBase 

which only returns the project DLL, but i can't figure out how to move up a few levels from there or what .net library to use to navigate around the path.

there's no ../.. :(

Basically i want to navigate to the Content/xsl folder which is at the same level of the Bin directory.


You should Server.MapPath for this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号