Private Sub OpenFileDialog1_File Ok ByVal sender As System Object ByVa

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
Dim myRegex As Regex
Dim myMatch As Match
Dim line As String
Dim FileReader As New System.IO.StreamReader(OpenFileDialog1.FileName)
myRegex = New Regex("^(OK\|)")
While Not FileReader.EndOfStream
line = FileReader.ReadLine()
myMatch = myRegex.Match(line)
If Not myMatch.Success Then
ListBox1.Items.Add(line)
End If
End While
FileReader.Close()
End Sub