http://www.equaldisparity.com/listbox1.jpg
As you can see I have a listbox full of URLs. I would like to go through this list looking through the source code for each URL for the word "error" ... if the word is found, I would like to add "ERROR FOUND" to the end of the URL in the listbox. If not found, I would like to add "NOT FOUND" to the end of the URL in the listbox.
Here's the code I already have for getting the source code of the URL:
Where URL-GOES-HERE is where the the URL goes, obviously.Code:Function DownloadChunks(ByVal sURL As String)
Dim wRemote As System.Net.WebRequest
Dim bBuffer(999) As Byte
Dim sResponseData As String
Dim iBytesRead As Integer
wRemote = WebRequest.Create(sURL)
Dim sChunks As Stream = wRemote.GetResponse.GetResponseStream
Do
iBytesRead = sChunks.Read(bBuffer, 0, 1000)
sResponseData &= System.Text.Encoding.UTF8.GetString(bBuffer)
Loop Until iBytesRead = 0
sChunks.Close()
Return sResponseData
End Function
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click
Dim sData As String = DownloadChunks(URL-GOES-HERE)
txtHTML.Text = sData
End Sub
Any help on how I can do this with the listbox? Thanks!
