#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 400
#End Region
Sub Process_Globals
Private MainForm As Form
Private Button1 As Button
Dim job1 As HttpJob
Dim i = 1 As Int
Private TextArea1 As TextArea
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("main") 'Load the layout file.
MainForm.Show
End Sub
Sub Button1_MouseClicked (EventData As MouseEvent)
'Start downloads
job1.Initialize("Job1", Me)
job1.Download("http://www.google.com")
End Sub
Sub JobDone (Job As HttpJob)
If Job.Success = True Then
Log("Downloaded " & i & " times")
Else
Log("Error: " & Job.ErrorMessage)
End If
Job.Release
If i = 15 Then '15 times
Log("End")
Else
i = i+1
job1.Download("http://www.google.com")
End If
End Sub