手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >Asp.net获取当前目录的方法小结
Asp.net获取当前目录的方法小结
摘要:方法一: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使用gridview获取当前行的索引值

ASP.NET连接MySql数据库的2个方法及示例

asp.net注册Javascript的方法

asp.net简化接收参数值的函数

asp.net Ajax 安装与卸载方法

在asp.net下实现Option条目中填充前导空格的方法

Asp.net清空cache禁用页面缓存的方法

asp.net GridView 中增加记录的方法

asp.net Timer的使用方法

asp.net2.0中css失效的解决方法

精品推荐
分类导航