读书人

Server.MapPath路径设置

发布时间: 2014-01-28 21:19:13 作者: rapoo

string path = Server.MapPath("/MyWebSite");

Server.MapPath路径设置有没有问题?

------解决方法--------------------------------------------------------
("\MyWebSite");不知道要不要加@
------解决方法--------------------------------------------------------
string path = Server.MapPath("/MyWebSite");
Server.MapPath是路径 是对象
string是引用类型
怎么能相等呢?
------解决方法--------------------------------------------------------
string path = Server.MapPath("\\MyWebSite");
------解决方法--------------------------------------------------------
string path = Server.MapPath("~\MyWebSite");

        

读书人网 >.NET

热点推荐