VB.NET HTTP Download with percent-done progress monitoring
Here is an example:
Dim WithEvents http As Chilkat.Http
Private Sub http_OnPercentDone(ByVal sender As Object, ByVal args As Chilkat.PercentDoneEventArgs) Handles http.OnPercentDone
ProgressBar1.Value = args.PercentDone
End Sub
Private Sub HttpDownloadTest()
http = New Chilkat.Http()
Dim success As Boolean
' Any string unlocks the component for the 1st 30-days.
success = http.UnlockComponent("Anything for 30-day trial")
If (success <> True) Then
MsgBox(http.LastErrorText)
Exit Sub
End If
' Enable event callbacks...
http.EnableEvents = True
' Download the Python language install.
' Note: This URL may have changed since this example was created.
success = http.Download("http://www.python.org/ftp/python/2.5/python-2.5.msi", "python-2.5.msi")
If (success <> True) Then
MsgBox(http.LastErrorText)
Else
MsgBox("Python Download Complete!")
End If
http = Nothing
End Sub
admin
0
Tags :