In my form I have 1 textbox , 1 labels and 1 button + I've added a resource file "sites.txt"
Now in the textbox i should enter the URL of the site and when I click the button , the application should search in the resource file "sites.txt" for the URL of the site , if the site was found then in the label the word "INFECTED" must appear and if not the word "NOT INFECTED" must appear in the label .
My code is :
Label1.Text = "" Dim FileContents() As String = IO.File.ReadAllLines("sites.txt") For I = 0 To FileContents.Length - 1 Dim LineParts As String = FileContents(I) If TextBox1.Text = LineParts Then Label1.Text = "Infected" Else : Label1.Text = "Not Infected" End If Next
But my problem is when the URL of a site is found in "sites.txt" , the word is always "Not Infected"
Any suggestions would be appreciated