花园里的花真多啊,多的就像天上的星星,密密麻麻;花园里的花真彩啊,一枝枝花朵五彩斑斓,向天边的霞光,那么耀眼,像高空的彩虹那么绚烂;花园里的花真香啊,香的让你感觉到自己仿佛在画中游玩一样,这时有人拍我一下,我才知道自己在花园里游玩。
页面后台cs文件的相对网站根目录的路径/view/Atlas
string rootPath1= Server.MapPath("~");
string rootPath2 = Request.ApplicationPath;
string path1 = Server.MapPath("upload");
string path2 = Server.MapPath("");
string path3 = Server.MapPath(".");
string path4 = Server.MapPath("..");
string path5 = Server.MapPath(Request.ServerVariables["PATH_INFO"]);
结果
string rootpath1= "F:\\ASP.NET_Projects\\超凡装饰\\cfzs\\Web\\cfzs\\Web";
string rootpath2= "/Web";
string path1 = "F:\\ASP.NET_Projects\\超凡装饰\\cfzs\\Web\\view\\Atlas\\upload\\cfzs\\Web\\view\\Atlas\\upload";
string path2 = "F:\\ASP.NET_Projects\\超凡装饰\\cfzs\\Web\\view\\Atlas\\cfzs\\Web\\view\\Atlas";
string path3 = "F:\\ASP.NET_Projects\\超凡装饰\\cfzs\\Web\\view\\Atlas\\cfzs\\Web\\view\\Atlas";
string path4 = "F:\\ASP.NET_Projects\\超凡装饰\\cfzs\\Web\\view\\cfzs\\Web\\view";
string path5 = "F:\\ASP.NET_Projects\\超凡装饰\\cfzs\\Web\\view\\Atlas\\Add.aspx\\cfzs\\Web\\view\\Atlas\\Add.aspx";
以上就是asp.net获取网站目录物理路径示例。如果当初我们能坚持的走下去,今天的结局就不会这么匆匆收场。更多关于asp.net获取网站目录物理路径示例请关注haodaima.com其它相关文章!