./ ../ ~/区别

关于上传路径:Server.MapPath("./upfile") ,指的是当前你所访问网页的物理路径。

Server.MapPath("../upfile"), 指的是当前你所访问网页的上一层物理路径。

Server.MapPath("~/upfile"), 指的是网站的根目录.

比如说,Server.MapPath("./upfile") 的返回值为:D:BackupTESTcheck ewupfile

则Server.MapPath("../upfile") 的返回值为:D:BackupTESTcheckupfile

Server.MapPath("~/upfile")的返回值为: D:BackupTESTupfile

其中,TEST是网站的根目录

怎么修改自己该明白了吧~ 需要你自己动手去实验 你就能记得更清楚~

答案是 string path = Convert.ToString(Server.MapPath("./upfile"));

from:https://zhidao.baidu.com/question/140970636.html

原文地址:https://www.cnblogs.com/liuqiyun/p/6897773.html