我一直在研究this excellent Stack post约Server.MapPath()
,我找不到任何东西,从我目前的位置需要我2级。Server.MapPath()不能升级2级?
Server.MapPath("./"); // this works - current path
Server.MapPath("../"); // this works - parent path
Server.MapPath("/"); // this works - virtual root path (2 levels HIGHER than I need)
Server.MapPath(".../"); // This fails
有没有办法上升2级? (这将是父文件夹的父代。)
是的,我可以通过转到虚拟根目录然后解析/合并来完成此操作,但这看起来很骇人听闻。寻找更优雅或规范的东西。
难道不是'../../'? –