额我需要从对方服务器上指定的路径下载图片。有对方的服务器的IP,权限,账户密码都有。我该怎么做?广域网下!
没头绪,泪汪汪的求指点。

解决方案 »

  1.   

    WebClient client = new WebClient();
    NetworkCredential cred = new NetworkCredential("username", "password", "172.16.0.222");
    client.Credentials = cred;
    client.DownloadFile("http://xxxx/test/111.txt", "111.txt");
      

  2.   

    +1如果这个不行就需要使用FTP上传下载了,如果这个满足不了我再来跟帖
      

  3.   

    System.Net.WebClient client = new System.Net.WebClient();
            System.Net.NetworkCredential cred = new System.Net.NetworkCredential("administrator", "zxd~bxgg", "192.168.18.98");
            client.Credentials = cred;
            client.DownloadFile("http://192.168.18.98/D:/company/chuangkou/Temporary/photo/20110423164805-Photo (8).jpg", "20110423164805-Photo (8).jpg");//远程服务器返回错误: (404) 未找到。  是什么情况
      

  4.   

    http://192.168.18.98/D:/company/chuangkou/Temporary/photo/20110423164805-Photo (8).jpg路径有问题。家一个操作共享文件的例子。
    http://hi.baidu.com/mydelicious/blog/item/f2735ecba5bca61bbf09e6dc.html