Hello,
I've made a program that can download a file on a http site with inet.
--------------VisualBasicCodeBEGIN--------------
Private Sub Command1_Click()
Dim URL As String
Dim LocalFileName As String
Dim Contents() As Byte
URL = "Inet1.Protocol = icHTTP
Inet1.URL = URL
Contents() = Inet1.OpenURL(Inet1.URL, icByteArray)
Do Until Inet1Ready(False)
DoEvents: DoEvents: DoEvents: DoEvents
Loop
Open LocalFileName For Binary Access Write As #1
Put #1, , Contents()
Close #1
End Sub
Private Function Inet1Ready(ShowMessage As Boolean)
On Error Resume Next
If Inet1.StillExecuting Then
Inet1Ready = False
If ShowMessage Then
End If
Else
Inet1Ready = True
End If
End Function
--------------VisualBasicCodeEND--------------
This code works fine, but I want to add a progress bar or a textbox how many procent of the download is already done, and eventually the size of the file; does anyone know a code to do this or another possibility to download a file from a http site with a progress bar?
Rikeman.
I've made a program that can download a file on a http site with inet.
--------------VisualBasicCodeBEGIN--------------
Private Sub Command1_Click()
Dim URL As String
Dim LocalFileName As String
Dim Contents() As Byte
URL = "Inet1.Protocol = icHTTP
Inet1.URL = URL
Contents() = Inet1.OpenURL(Inet1.URL, icByteArray)
Do Until Inet1Ready(False)
DoEvents: DoEvents: DoEvents: DoEvents
Loop
Open LocalFileName For Binary Access Write As #1
Put #1, , Contents()
Close #1
End Sub
Private Function Inet1Ready(ShowMessage As Boolean)
On Error Resume Next
If Inet1.StillExecuting Then
Inet1Ready = False
If ShowMessage Then
End If
Else
Inet1Ready = True
End If
End Function
--------------VisualBasicCodeEND--------------
This code works fine, but I want to add a progress bar or a textbox how many procent of the download is already done, and eventually the size of the file; does anyone know a code to do this or another possibility to download a file from a http site with a progress bar?
Rikeman.