1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Dim request As System.Net.HttpWebRequest = CType(System.Net.HttpWebRequest.Create(URL), Net.HttpWebRequest)
Dim response As System.Net.HttpWebResponse = CType(request.GetResponse, Net.HttpWebResponse)
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.Default)
Dim str As String = sr.ReadToEnd
request.Abort() : response.Close() : sr.Close()
If str.Length > 0 Then
Dim i As New System.Text.RegularExpressions.Regex("img alt="""" src=""(.*)""", RegexOptions.Compiled)
Dim r As New System.Text.RegularExpressions.Regex("<td>(.*?)</td>", RegexOptions.IgnoreCase)
Dim matches As MatchCollection = i.Matches(str)
Dim matchec As MatchCollection = r.Matches(str)
For Each itemImg As Match In matches
For Each itemcode As Match In matchec
imglist.Images.Add(ChargerImage("http://flux.radio.free.fr/" & itemImg.Groups(1).Value))
ListView1.Items.Add("", imglist.Images.Count - 1).SubItems.Add(itemcode.Groups(1).Value)
'Exit For < afficher bien l'image une par une mais station sont tous les mémes.
Next
Exit For < afficher bien tous les stations mais affiche la méme image.
Next
End If |
Partager