Results 1 to 2 of 2

Thread: Need Help With A Log In System!

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    11

    Post Need Help With A Log In System!

    I am doing a log in system and everything works fine except whether you get the password correct or not as long as the username is right it logs in. Can someone help and tell me what I should change on the codes for this login button?

    Thanks,

    If My.Computer.FileSystem.DirectoryExists(" C:\ACCOUNTS" + TextBox1.Text + "\") Then
    Dim USERREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "USERNAME.TXT")
    Dim userline As String
    Dim PASSREAD As System.IO.StreamReader = New System.IO.StreamReader("C:\ACCOUNTS" + TextBox1.Text + "\" + "PASSWORD.TXT")
    Dim passline As String
    Do
    passline = TextBox2.Text
    userline = USERREAD.ReadLine
    Console.WriteLine(passline)
    Console.WriteLine(userline)
    Loop Until userline Is Nothing
    Form2.ShowDialog()
    Me.Close()
    If TextBox2.Text = "" Then
    MsgBox("Please input both username and password to login", MsgBoxStyle.Critical)
    Else
    If passline = PASSREAD.ReadLine() = True Then
    End If
    End If
    Else
    MsgBox("The username or password was incorrect. please try again.", MsgBoxStyle.Critical)
    End If

    End Sub

    Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Need Help With A Log In System!

    Follow the CodeBank link in my signature and check out my WinForms Login thread.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Tags for this Thread

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