获取根目录

1.类中获取根目录

string path = HttpRuntime.AppDomainAppPath.ToString();

2.页面获取

Server.MapPath("") 或者 Server.MapPath("~/");//返回与Web服务器上的指定的虚拟路径相对的物理文件路径

posted @ 2015-12-17 11:03  lqqqiaoqiao  阅读(146)  评论(0编辑  收藏  举报