zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Asp.net获取当前目录的方法小结

NetASP方法 获取 小结 当前目录
2023-06-13 09:15:03 时间

方法一:

stringsPath=System.IO.Path.GetDirectoryName(Page.Request.PhysicalPath)

方法二:

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

方法三:
stringsPath=Page.Server.MapPath("/");

我推荐使用第二种