Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ProgressBar1.Maximum = ListBox1.Items.Count For i As Integer = 0 To ListBox1.Items.Count - 1 Dim t As New Threading.Thread(AddressOf dwnld) t.Start(ListBox1.Items(i).ToString) Next End Sub
Public Sub dwnld(ByVal url As String) Try Dim result As String = String.Empty Dim txt As String = "" Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest) request.Method = "GET" Using stream = request.GetResponse().GetResponseStream() Using reader = New StreamReader(stream, Encoding.UTF8) result = reader.ReadToEnd() End Using End Using Dim doc As New HtmlAgilityPack.HtmlDocument() doc.Load(New StringReader(result)) Dim root As HtmlNode = doc.DocumentNode For Each link As HtmlNode In root.SelectNodes("//p") Dim att As String = link.InnerText.Trim txt = txt & att & vbCrLf Next Me.settext(txt) Catch ex As Exception End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)