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

解决方案 »

  1.   

    那不需要Server.MapPath
    直接用string _filedir = @"\\192.168.0.222\E\upload"
    就可以了。记得先将E:\设置为共享目录,在防火墙中允许文件共享,再在程序中先用WNetAddConnection2建立连接。
      

  2.   

    MapPath:eturns the physical file path that corresponds to the specified virtual path on the Web server.你的路径是virtual path on the Web server.吗?
      

  3.   

    共享 192.168.0.222 下 E:/upload --> Upload,当然设置好授权然后程式直接访问 string _filedir = "\\192.168.0.222\Upload"不需要使用Server.MapPath
      

  4.   

    Server.MapPath的作用是把和网站虚拟路径相关的相对路径转换为物理路径(盘符开始的路径)。
    比如相对于网站来说\upload,而网站位于C:\wwwroot\website1那么传入\upload它返回C:\wwwroot\website1\upload1。