Results 1 to 3 of 3

Thread: [RESOLVED] [2008] Compare string to line in txt file

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    62

    Resolved [RESOLVED] [2008] Compare string to line in txt file

    I'm trying to see if my string contains a line from a .txt

    This works, but it is reading and showing in the msgbox the next line down from what I want. Also, I don't want it to stop when it hits the first one found. It should keep going until the end of the string.

    What's wrong with the code?

    Code:
            Dim objReader As New System.IO.StreamReader(MyTempFilePath)
    
            Do While objReader.Peek() <> -1
                If editorstring.Contains(objReader.ReadLine) Then
                    MsgBox("String contains: " & objReader.ReadLine)
                End If
            Loop
    Last edited by rhijaen; Mar 2nd, 2008 at 06:34 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width