Global.asax取物理路径/取绝对路径代码

作者:简简单单 2013-04-25

虚拟路径

 代码如下 复制代码

Server.MapPath("~/") 取得的就是虚拟路径

取绝对路径

string absolutelyPath =AppDomain.CurrentDomain.BaseDirectory;

取物理路径和应用程序路径

 代码如下 复制代码

System.Web.HttpContext.Current.Request.ApplicationPath

相关文章

精彩推荐