Global.asax取物理路径/取绝对路径具体方法

内容摘要
虚拟路径复制代码 代码如下:Server.MapPath("~/") 取得的就是虚拟路径

取绝对路径复制代码 代码如下:string absolutelyPath =AppDomain.CurrentDomain.BaseDirectory;取物
文章正文

虚拟路径

复制代码 代码如下:

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

取绝对路径

复制代码 代码如下:

string absolutelyPath =AppDomain.CurrentDomain.BaseDirectory;

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

复制代码 代码如下:

System.Web.HttpContext.Current.Request.ApplicationPath


代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!