1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Trouble Loading List / Trouble Logging In

Discussion in 'Visual Basic .NET' started by Awakening, Oct 15, 2012.

  1. Awakening

    Awakening Junior Member

    Joined:
    Oct 9, 2012
    Messages:
    117
    Likes Received:
    44
    I am attempting to make a mass account checker for Instagram.

    I have 2 text boxes set up and when I TYPE the username + password into those boxes and press login, it works fine.
    However, when I load my text file containing accounts in the format "user:pass" into two separate lists and try and log in, the log in never works. Any idea why?

    I think it may be the code to load the accounts I am using which is as follows:
    Code:
      Public Function LoadList()        'Declare Variables
            Dim objReader As New System.IO.StreamReader(FileLocation)
            Dim LineOfText As String = Nothing
            Dim Aryline(1) As String
            Dim FirstList As String
            Dim SecondList As String
            Do While objReader.Peek() <> -1
                LineOfText = objReader.ReadLine() & vbNewLine
                Aryline = LineOfText.Split(":")
                FirstList = Aryline(0)
                SecondList = Aryline(1)
                ListBox1.Items.Add(FirstList)
                ListBox2.Items.Add(SecondList)
                TotalAcc = TotalAcc + 1
                lblTotal.Text = TotalAcc & " Accounts Loaded"
            Loop
            'Close the Reader
            objReader.Close()
            Return Nothing
        End Function
    Thanks in advance!
     
  2. adh0c

    adh0c Newbie

    Joined:
    Apr 20, 2012
    Messages:
    11
    Likes Received:
    7
    Try this...
    I switched it to a Sub instead of a function since your just populating 2 listboxes.
    Your also reading line by line, so there is no need to append "NewLine" character:
    "LineOfText = objReader.ReadLine() & vbNewLine"
    I'm fairly certain that is why your password was failing.

    Code:
    Public Sub LoadList()        
            Dim objReader As New System.IO.StreamReader(FileLocation)
            Dim LineOfText As String = Nothing
            Do While objReader.Peek() <> -1
                LineOfText = objReader.ReadLine()
             Dim Aryline() as String = LineOfText.Split(":")
                ListBox1.Items.Add(Aryline(0).Trim) 'Usernames
                ListBox2.Items.Add(Aryline(1).Trim) 'Passwords
                lblTotal.Text = ListBox1.Items.Count & " Accounts Loaded"
            Loop
            'Close the Reader
            objReader.Close()
    End Sub
    
     
    • Thanks Thanks x 1
    Last edited: Oct 15, 2012
  3. Awakening

    Awakening Junior Member

    Joined:
    Oct 9, 2012
    Messages:
    117
    Likes Received:
    44
    Ahh! Thank you a lot for that.

    It's working now.