Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

How to check a raw online text for a specific text

Ok so basically what I am wanting to do is type something in a textbox for example "Dogs" and search a raw online text file for the textbox's text. Then if the textbox's text is in the online text file then it would return all the text following that line in a label like this.

ONLINE TEXT FILE:
Dogs:German Sheperd:Really Cool:Nice
Bag:ffdf:fdfd:fdfd

So the label would return Dogs:German Sheperd:Really Cool:Nice

If you can help I would really appreciate it. I have been trying to figure this out for forever.
Here is some shit I slapped together
Textbox1 is the URL
Textbox2 is the word or phrase your scanning for
Textbox3 is the output
Code
Imports System
Imports System.IO
Imports System.Text
Imports System.Net


Public Class Form1
    Dim url As String
    Dim webc As WebClient = New WebClient

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        url = TextBox1.Text
        If url <> "" Then
            Dim streamr As StreamReader = New StreamReader(webc.OpenRead(url))
            TextBox3.Text = streamr.ReadToEnd
            TextBox3.Text.Replace(":", " ")
            If TextBox3.Text.ToLower.Contains(TextBox2.Text.ToLower) Then
                Dim builder As New StringBuilder()
                For Each line As String In TextBox3.Text.Split(New String() {Environment.NewLine}, StringSplitOptions.None)
                    If line.ToLower().Contains(TextBox2.Text.ToLower) Or line.ToLower().Contains(TextBox2.Text) Then
                        builder.AppendLine(line)
                    End If
                Next
                TextBox3.Text = builder.ToString()
            Else
                TextBox3.Text = ""
            End If
        Else
            MsgBox("Enter a URL!")
        End If
    End Sub
End Class
/edit Fixed it so it's not case sensitive.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by neonbytesApr 4, 2026 10:10 AM 2 83 Apr 4, 2026 10:10 AM
Last Post: neonbytes
[Python] by xPrimodyJul 27, 2020 01:55 PM 3 160 Jul 27, 2020 01:55 PM
Last Post: Pernat1y
[C] by ShallowMEFeb 1, 2020 01:26 PM 5 199 Feb 1, 2020 01:26 PM
Last Post: m1n0r1tyrep0rt