我正在尝试下载 .zip 文件来为我的游戏制作自动更新程序。它需要显示进步。我按照在线教程获得了实际下载器的这段代码:
Dim SaveDirectory As String = "C:\Program Files (x86)\MyGame\"
Dim client As WebClient = New WebClient
AddHandler client.DownloadProgressChanged, AddressOf client_ProgressChanged
AddHandler client.DownloadFileCompleted, AddressOf client_DownloadCompleted
client.DownloadFileAsync(New Uri("https://example.com/game/download/latest.zip"), SaveDirectory)
我现在的问题是,当我运行 Windows 窗体应用程序时,会触发 DownloadFileCompleted 事件,但由于某种原因文件没有下载。
它大约是一个 34 MB 的 .zip 文件。任何帮助表示赞赏,非常感谢。