1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| ' Représente un élement à télécharger
Class DownloadItem
Public Text As String
Public Url As String
End Class
...
' Remplissage de la liste
Dim lst As New List(Of DownloadItem)
lst.Add(New DownloadItem With { .Text = "Microsoft Word", .Url = "http://..." })
lst.Add(New DownloadItem With { .Text = ".NET Framework 3.5", .Url = "http://..." })
lstlog.DataSource = lst
lstlog.DisplayMember = "Text"
...
' Télécharger l'élément sélectionné
Dim item As DownloadItem = CType(lstlog.SelectedItem, DownloadItem)
dd.download1(item.Url, nomDuFichier) |
Partager