Hello, in a certain part of my program, I need to search for some keywords in a text file. I'm using the IF and CONTAINS method for this, however, when he finds any of those keywords, he stops searching for the next ones, and I need him to search through to the end. My code:
Dim sr As New StreamReader(Path)
Dim rd As String
rd = sr.ReadToEnd()
If rd.Contains("IDCmdpaotj") Then
Str = "IDCmdpaotj **(Finded!)"
ListBox1.Items.Add(Str)
LabelText.Text = "IDCmdpaotj Found!"
End if
If rd.Contains("xxpodDooe") Then
Str = "xxpodDooe **(Finded!)"
ListBox1.Items.Add(Str)
LabelText.Text = "xxpodDooe Found!"
End if
The problem is that by finding "IDCmdpaotj", it simply stops and continues to try to find "xxpodDooe". Could someone help me?