方法一:
string sPath = System.IO.Path.GetDirectoryName(Page.Request.PhysicalPath)
方法二:
string sPath = System.Web.HttpContext.Current.Request.MapPath(\"/\")
方法三:
string sPath = Page.Server.MapPath(\"/\");
我推荐使用第二种
本文地址:https://www.stayed.cn/item/4718
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我