从网络服务器下载多个文件
问题描述:
VS 2008 SP1从网络服务器下载多个文件
我正在使用网络客户端下载文件。哪些工作正常。
但是,现在我必须下载许多文件,下载的文件数量每天都会改变。
我不知道如何让Web客户端知道哪些文件已被下载或没有?我正在考虑使用for循环来下载每个文件。但我永远不知道要下载多少个?
Web客户端可以下载同一文件两次?
非常感谢您的任何建议,
Private Sub btnStartDownload_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim client As New WebClient()
AddHandler client.DownloadProgressChanged, AddressOf client_DownloadProgressChanged
AddHandler client.DownloadFileCompleted, AddressOf client_DownloadFileCompleted
' Starts the download
client.DownloadFileAsync(New Uri("UrlFilePath"), "DownloadPath")
btnStartDownload.Text = "Download In Process"
btnStartDownload.Enabled = False
End Sub
答
之前我们已经建立了一个需要用户下载多个文件系统。我们解决它的方式是压缩服务器端的文件,然后将其作为单个文件下载。
+0
我不能那么做。用户希望下载所有单个文件,而不希望将其解压缩。 – ant2009 2009-07-30 19:11:37
的可能的复制[如何下载一个HTTP请求多个文件?(http://stackoverflow.com/questions/1041542/how-to-download-multiple-files-with-one- http-request) – Helen 2017-01-23 09:38:34