YAY !!!我找到了一個解決方案:
那裏是^^。謝謝你的答案。
Private Sub download_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Download.Click
Download.Enabled = False
httpclient = New WebClient
AddHandler httpclient.DownloadFileCompleted, AddressOf Downloaded
httpclient.DownloadFileAsync(New Uri("https://www.dropbox.com/s/2ch4prhn063hmxs/vanilla.exe?dl=1"), ("C:\BarberLand\downloads\Vanilla\vanilla.exe"))
End Sub
Private Sub dpc(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles httpclient.DownloadProgressChanged
porcentaje.Text = e.ProgressPercentage
End Sub
Private Sub Downloaded()
'Comprueba si el fichero se ha descargado completamente.
If System.IO.File.Exists("C:\BarberLand\downloads\Vanilla\vanilla.exe") = True Then
Process.Start("C:\BarberLand\downloads\Vanilla\vanilla.exe")
Me.Close()
Else
MsgBox("El fichero no existe, pruebe con otra versión o si piensa que es un error, contácte con el administrador", 64, "Open")
End If
End Sub
定義損壞? – Psychemaster 2014-09-26 08:16:39
編輯,對不起:D – 2014-09-26 11:38:14
由於很多原因,大多數Web服務器阻止下載EXE文件(通過http)。我認爲DownloadFile總是首先創建一個1KB文件,以確保您可以寫入所需的位置。你有控制網絡服務器嗎? – Steve 2014-09-30 16:39:28