Asp.net获取当前目录的方法小结
Asp.net获取当前目录的方法小结
发布时间:2016-12-29 来源:查字典编辑
摘要:方法一:stringsPath=System.IO.Path.GetDirectoryName(Page.Request.PhysicalP...

方法一:

string sPath = System.IO.Path.GetDirectoryName(Page.Request.PhysicalPath)

方法二:

string sPath = System.Web.HttpContext.Current.Request.MapPath("/")

方法三:

string sPath = Page.Server.MapPath("/");

我推荐使用第二种

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新asp.net教程学习
热门asp.net教程学习
编程开发子分类