[RESOLVED] [2005] Reading Lines
I have a code and this is how I need it to work.
1. Download page from the internet into a string.
2. Search through lines
3. If a line includes a certain string, add it to a textbox
4. Until the end of the lines.
But mine doesnt work.
VB Code:
Private Sub btnGrab_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGrab.Click
Dim externalPage As String = Nothing
Dim Line As String
externalPage = WebClient1.DownloadString("http://iat.awardspace.com/text.txt")
Dim streamr As New IO.StreamReader(externalPage)
While Not streamr.EndOfStream
Line = streamr.ReadLine
If Line.Contains("S") Then
TextBox1.Text = TextBox1.Text & Line.ToString & vbNewLine
End If
End While
End Sub
Im fairly new to VB.NET and I know I've done something wrong. I think it's something to do with the StreamReader. Its supposed to read streams, but I dont have any. Can anybody help me get this working please?