简体   繁体   English

WPF C# 下载多个文件

[英]WPF C# Download Multiple Files

I can't seem to find any examples of downloading multiple files from a URL.我似乎找不到任何从 URL 下载多个文件的示例。 I have a URL lets say www.example.com/Document and I want to download all the files in that URL is that possible?我有一个 URL 可以说 www.example.com/Document,我想下载 URL 中的所有文件,这可能吗? or do I need to provide the name of each file in that URL?还是我需要在 URL 中提供每个文件的名称? All the files would download to a folder specified here in the code.所有文件都将下载到代码中指定的文件夹中。

Any examples of this would be great, this would be done by clicking a Download button in WPF.这方面的任何例子都很好,这可以通过单击 WPF 中的下载按钮来完成。

The way I did this was to create a ZIP file and have all the files in there.我这样做的方法是创建一个 ZIP 文件并将所有文件都放在其中。 You can either pre create a ZIP file and download or you can create the ZIP file as it downloads.您可以预先创建 ZIP 文件并下载,也可以在下载时创建 ZIP 文件。 I had to write my own software to do that but it does work.我必须编写自己的软件才能做到这一点,但它确实有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM