【发布时间】:2010-11-15 13:42:28
【问题描述】:
VS 2008 SP1
我正在使用网络客户端下载文件。哪个工作正常。
但是,现在我要下载很多,而且要下载的文件数量每天都在变化。
我不确定如何让 Web 客户端知道哪些文件已下载或未下载?我正在考虑使用 for 循环来下载每个文件。但我永远不知道有多少要下载?
网络客户端可以下载同一个文件两次?
非常感谢您的任何建议,
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
【问题讨论】:
标签: vb.net