项目是这样的:
根据程序条件,后台的(C/S)的程序,需要批量上传一组文件(可能有几百个)到服务端,如果手工上传肯定不行,所以想这个办法是不是可以实现:
http://server/upfile.aspx?filename=c:\文件名.xls
如果不能实现,有什么好的办法可以借用,谢谢

解决方案 »

  1.   

    我看帮助好像是可以,不知怎么实现,真晕:
    Console.Write("\nPlease enter the URL to post data to : ");
    String uriString = Console.ReadLine();// Create a new WebClient instance.
    WebClient myWebClient = new WebClient();Console.WriteLine("\nPlease enter the fully qualified path of the file to be uploaded to the URL");
    string fileName = Console.ReadLine();Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString);                        
    // Upload the file to the URL using the HTTP 1.0 POST.
    byte[] responseArray = myWebClient.UploadFile(uriString,"POST",fileName);// Decode and display the response.
    Console.WriteLine("\nResponse Received.The contents of the file uploaded are: \n{0}",Encoding.ASCII.GetString(responseArray));
      

  2.   

    到底是C/S还是B/S啊?    C/S 当然是可以的, 不过你又写的是 一个网页,真牛~~~~如果是C/S,什么都不传了,直接在客户端写逻辑向上面传就完了.
      

  3.   

    看了一下帮助,WebClient好像有此功能,不知如何使用它?
    是这样的:
    后台的程序(C/S)的程序,需要上传文件到服务器,想通过B/S实现此功能。
    后台的计算与服务器在不同地方,服务器除80端口外不开放任何端口。
    哪位对WebClient很了解的帮助一下,谢谢
      

  4.   

    自己写个FTP客护端程序不就行了
      

  5.   

    B/S是不行的,不用问了...
    当然你可以用ActiveX
      

  6.   

    在c/s中是很简单的事
    但是在b/s中就不行了,安全不允许
    用active是一种选择,但你的麻烦会更多,因为很多的浏览器都屏蔽/阻止active了