Expand|Select|Wrap|Line Numbers
- If System.IO.File.Exists(FILE_NAME) = True Then
- Dim fs As New FileStream(FILE_NAME, FileMode.Open, FileAccess.Read)
- Dim sr As New StreamReader(fs)
- Dim Contents As String = sr.ReadToEnd()
- Dim strSearch As String = "^(.*?)" & Quest.Text & ""
- Dim myRegex As New Regex(strSearch, RegexOptions.Multiline)
- If myRegex.IsMatch(Contents) Then
- Dim myMatch As Match = myRegex.Match(Contents)
- Dim theFoundLine As String = myMatch.Groups(0).Value
- 'Display the found line
- Dim splitText() As String = theFoundLine.Split(";")
- OS01Rec.Text = splitText(0).Trim
- os01a.Text = splitText(1).Trim
- OS01b.Text = splitText(2).Trim
- OS01c.Text = splitText(3).Trim
- ...................... so on
Thanks.