Fork me on GitHub

[备忘录]三种方法取得网站根目录的物理路径

1.HttpContext.Current.Server.MapPath("~"); 2.HttpRuntime.AppDomainAppPath(推荐); 3.AppDomain.CurrentDomain.BaseDirectory; 结果: E:\IIS\WebApi\ 理由: 第1种写法,有
posted @ 2016-02-29 09:33  VAllen  阅读(2307)  评论(6编辑  收藏  举报