I am trying to read web pages, for example I would like to detect the string "My server" in the answer.
I found this:
Dim Str As System.IO.Stream
Dim srRead As System.IO.StreamReader
Try
' make a Web request
Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("http://localhost/quietoputo")
Dim resp As System.Net.WebResponse = req.GetResponse
StR = resp.GetResponseStream
srRead = New System.IO.StreamReader(Str)
' read all the text
RichTextBox1.Text = srRead.ReadToEnd
Catch ex As Exception
RichTextBox1.Text = "Unable to download content"
Finally
' Close Stream and StreamReader when done
srRead.Close()
Str.Close()
End Try
If we enter the web we simply see a title "My server:" followed by another title with the IP. My intention is to detect if the web I have visited has the string "My server:" and save the IP in a textbox or variable or whatever.
How could I do it?