How to continue the code after IF

1

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?

    
asked by anonymous 09.11.2018 / 19:20

1 answer

0

Solved! The code was inside one timer, and the code was being stopped by another. Without this, everything flowed as expected. Thanks for the help!

    
11.11.2018 / 22:09