获取根目录
1.类中获取根目录
string path = HttpRuntime.AppDomainAppPath.ToString();
2.页面获取
Server.MapPath("") 或者 Server.MapPath("~/");//返回与Web服务器上的指定的虚拟路径相对的物理文件路径
1.类中获取根目录
string path = HttpRuntime.AppDomainAppPath.ToString();
2.页面获取
Server.MapPath("") 或者 Server.MapPath("~/");//返回与Web服务器上的指定的虚拟路径相对的物理文件路径