从Web服务器下载多个文件 [英] Dowload Multiple Files from Webserver

查看:101
本文介绍了从Web服务器下载多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网络服务器上大约有20个文件.文件的名称为7JNProductMaster.txt,7BPProductMaster.txt.文件名的前3个字符是业务员代码.对于一个推销员,我有6-7个文件,现在我要下载特定推销员的所有文件.我使用了webclient.Downloaddata bur一次下载了一个文件.我只想提供SalesmanCode和所有包含该代码的文件,例如下载.----


I have around 20 files on webserver. The name of the File are 7JNProductMaster.txt,7BPProductMaster.txt. The first 3 chars of the file name is a salesman code. for one salesman i have 6-7 files, now i want to download the all the files for the paricular salesman. i used webclient.Downloaddata bur it downloads the one file at time. i want to provide only the SalesmanCode and all the files which conatins that code get downloaded Eg.----


WebClient request = new WebClient();
  byte[] fileData = request.DownloadData("Webserverath" + SalesmanCode + "*.txt");

推荐答案

执行此操作的唯一方法是遍历文件并一次下载一个文件,除非您可以在服务器上进行一些创建您想要的所有文件的zip文件.就个人而言,我会在服务器上放置一个带有Salesmans前缀的Web服务,然后根据需要在服务器上创建一个zip,然后将其发送回去.
The only way to do this is to iterate over the files and download them one at a time, unless you can get something on the server to create a zip of all the files you want. Personally, I''d put a webservice on the server that takes a salesmans prefix, then creates a zip on the server as needed, and sends it back.


这篇关于从Web服务器下载多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆