Platforms to show: All Mac Windows Linux Cross-Platform

/CURL/Multi Transfer automatic


You find this example project in your Plugins Download as a Xojo project file within the examples folder: /CURL/Multi Transfer automatic

This example is the version from Mon, 10th Sep 2023.

Project "Multi Transfer automatic.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() urls = Array(_ "http://www.microsoft.com",_ "http://www.opensource.org",_ "http://www.google.com",_ "http://www.yahoo.com",_ "http://www.ibm.com",_ "http://www.mysql.com",_ "http://www.oracle.com",_ "http://www.ripe.net",_ "http://www.iana.org",_ "http://www.amazon.com",_ "http://www.netcraft.com",_ "http://www.heise.de",_ "http://www.chip.de",_ "http://www.ca.com",_ "http://www.cnet.com",_ "http://www.news.com",_ "http://www.cnn.com",_ "http://www.wikipedia.org",_ "http://www.dell.com",_ "http://www.hp.com",_ "http://www.cert.org",_ "http://www.mit.edu",_ "http://www.nist.gov",_ "http://www.ebay.com",_ "http://www.playstation.com",_ "http://www.uefa.com",_ "http://www.ieee.org",_ "http://www.apple.com",_ "http://www.sony.com",_ "http://www.symantec.com",_ "http://www.zdnet.com",_ "http://www.fujitsu.com",_ "http://www.supermicro.com",_ "http://www.hotmail.com",_ "http://www.ecma.com",_ "http://www.bbc.co.uk",_ "http://news.google.com",_ "http://www.foxnews.com",_ "http://www.msn.com",_ "http://www.wired.com",_ "http://www.sky.com",_ "http://www.usatoday.com",_ "http://www.cbs.com",_ "http://www.nbc.com",_ "http://slashdot.org",_ "http://www.bloglines.com",_ "http://www.techweb.com",_ "http://www.newslink.org",_ "http://www.un.org") for i as integer = 1 to 20 DownloadOneURL next End EventHandler
Sub DownloadOneURL() If UBound(urls) = -1 Then Return Dim URL As String = URLs.Pop Dim c As New CURLSMBS // setup request and any options you need c.OptionURL = URL c.OptionUserAgent = "MyDownloader 1.0" If CURLSMultiMBS.SharedInstance.AddCURL(c, AddressOf TransferFinished) Then Log "Downloading: "+URL else Break end if End Sub
Sub TransferFinished(CURL as CURLSMBS, ErrorCode as Integer) // check this in debugger if you like Dim outputData As String = curl.OutputData Dim DebugMessages As String = curl.DebugMessages #Pragma Unused outputData #Pragma Unused DebugMessages If ErrorCode <> 0 Then // failed, so please inspect debug messages Break End If MainWindow.Log "Transfer done with error code "+Str(ErrorCode)+" for "+curl.OptionURL+", "+Str(CURLSMultiMBS.SharedInstance.RunningTransfers)+" transfers running." MainWindow.DownloadOneURL End Sub
Sub log(s as string) List.AddRow s List.ScrollPosition = List.LastIndex End Sub
Property urls() As string
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

See also:

The items on this page are in the following plugins: MBS CURL Plugin.


The biggest plugin in space...