首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

Server.MapPath路径有关问题

2013-02-03 
Server.MapPath路径问题string _filedir Server.MapPath(192.168.0.222/E:/upload)报错不支持给定路

Server.MapPath路径问题
string _filedir = Server.MapPath("192.168.0.222/E:/upload");
报错
不支持给定路径的格式。
E:\upload  在192.168.0.222是存在的 路径问题
[解决办法]
MapPath:

eturns the physical file path that corresponds to the specified virtual path on the Web server.

你的路径是virtual path on the Web server.吗?
[解决办法]
共享 192.168.0.222 下 E:/upload --> Upload,当然设置好授权

然后程式直接访问 string _filedir = "\\192.168.0.222\Upload"

不需要使用Server.MapPath

热点排行