我一直在研究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級? (這將是父文件夾的父代。)
是的,我可以通過轉到虛擬根目錄然後解析/合併來完成此操作,但這看起來很駭人聽聞。尋找更優雅或規範的東西。
難道不是'../../'? –