To use XFile's ActiveX download control from Visual Basic,
Exercise 11: Downloading with the ActiveX Control in Visual BasicWe will create a simple, one-file download in Visual Basic, using XFile's ActiveX control and its progress indicator. The project includes two forms: Form1 and Form2. Form1 contains the download control AXFFileDownload, and Form2 contains the progress indicator AXFFileProgress. |
|
Private Sub Command1_Click()
Dim XFile As Object
Set XFile = AXFFileDownload1.XFRequest
Form2.Show
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
AXFFileDownload1.AddFile "c:\temp\Pleasereadme.txt", "http://localhost/saxfilesamples/Readme.txt"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Form2
End Sub
Private Sub Form_Load()
Me.Show
ShowProgress
StartTransfer
End Sub
Private Sub ShowProgress()
AXFFileProgress1.XFRequest = Form1.AXFFileDownload1.XFRequest
AXFFileProgress1.ShowProgress
End Sub
Private Sub StartTransfer()
Form1.AXFFileDownload1.Start
End Sub
Command1_Click()
procedureDim XFile As Object
Set XFile = AXFFileDownload1.XFRequest
Form2.Show
Command2_Click()
procedureUnload Me
Form_Load()
procedureAXFFileDownload1.AddFile "c:\temp\Pleasereadme.txt", "http://localhost/saxfilesamples/Readme.txt"
Form_Unload(Cancel as Integer)
procedureUnload Form2
Form_Load()
procedureMe.Show
ShowProgress()
procedure:ShowProgress
StartTransfer()
procedure:StartTransfer
ShowProgress()
procedureAXFFileProgress1.XFRequest = Form1.AXFFileDownload1.XFRequest
AXFFileProgress1.ShowProgress
StartTransfer()
procedureForm1.AXFFileDownload1.Start