Asp.net 获取当前目录的三种方法

 

 

方法一:

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

方法二:

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

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

posted @ 2011-10-30 21:15  撸码兔兔  阅读(408)  评论(0编辑  收藏  举报