简体   繁体   中英

How to get physical directory path to path created by server?

I have an asp.net mvc web application that I deployed to a server. The app has an exe file that I keep in a known parent directory on my local machine and I call it using MapPath like this:

string path = HttpContext.Current.Server.MapPath("~/parentDirectory/");.

The problem is, the server where I deploy to, doesn't keep the file in the same directory and I therefore have no way of calling it during compile time using this method. Is there any way I can call the exe file dynamically just by its name or another way to get the server's path?

最好的选择是在web.config文件中使用appsetting,并在部署应用程序时让服务器管理员添加路径。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM