Results 1 to 2 of 2

Thread: extracting data from a txt file

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    13

    Question extracting data from a txt file

    i have a txt file that contains an id and password (divided by a tab). i can retrieve the txt file with streamreader, but now i need to extract the id and password separately. i need to make it so that it checks what the user inputs mskedit box equals the id number, and the text box input equals the password.

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    This is the same as a few posts. You should search before asking:

    VB Code:
    1. 'input file here..
    2.  
    3. Dim data As String = FileStream.ReadLine() 'input the line
    4. Dim parts() As String = data.Split(Char.Parse(ControlChars.Tab))
    5.  
    6. If username = parts(0) Then
    7.     'username matches
    8. End If
    9.  
    10. If password = parts(1) Then
    11.     'password matches
    12. End If
    13.  
    14. 'If (username = parts(0)) And (password = parts(1)) Then
    15.     'do your stuff
    16. 'End If

    Phreak
    Last edited by «°°phReAk°°»; Apr 11th, 2004 at 03:40 PM.

    Visual Studio 6, Visual Studio.NET 2005, MASM

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