how to create a login form using for loop and class and the date are stored in note.txt
example
when the user enter a name and password the program will check if that user is existing or not .Thanks

Have you tried setting a breakpoint and single-stepping your way though? It might give you a better understanding of your code. That said . . .
Dim user As New clsLogin
If user.strUser_Type = "Administrator" Then
Why are you using user instead of All_Users(i)?
Hi i see No one Answer so I try to solve it myself but didn't go anywhere here is my code if u can try to fix it or tell me where did i go wrong ^^ just give me a clue
or the logic for it so i can move onPublic Class frmLogin Dim Loginusers As New List(Of Login) Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click Dim user As New Login If txtusername.Text = user.strUser_Name Then If txtPassword.Text = user.strPassword Then If user.strUser_Name = user.blnUser_Type = "Administrator" Then Me.Hide() frmLibraryAdmin.Show() Else Me.Hide() frmLibraryRegular.Show() End If Else MsgBox("PLease Enter A Correct Password") End If Else MsgBox("Please Enter A correct User Name") End If End Sub Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim loginformation As New System.IO.StreamReader("LogInfo.txt") While Not loginformation.EndOfStream Dim user As New Login user.strEmployee_name = loginformation.ReadLine user.strEmployee_ID = loginformation.ReadLine user.blnUser_Type = loginformation.ReadLine user.strUser_Name = loginformation.ReadLine user.strPassword = loginformation.ReadLine Loginusers.Add(user) End While loginformation.Close() End Sub End Classedited by moderator: Added pre tags -Razor2.3
thanx but i dont know how to use for each so i tried for next loop it work but only send me to form3 not form2 even if i enter the right user name and password here is the new code that i wrote For i = 0 To All_Users.Count - 1 If txtusername.Text = All_Users(i).strUser_Name Then AdminFound = True If txtPassword.Text = All_Users(i).strPassword Then Dim user As New clsLogin If user.strUser_Type = "Administrator" Then Me.Hide() frmAdmin.Show() Else Me.Hide() frmRegular.Show() End If Else MsgBox("Incorrect Password !! :P ") End If End If Next If AdminFound = False Then MsgBox("Incorrect User Name XD ") End Ifedited by moderator: Added pre tags -Razor2.3
Have you tried setting a breakpoint and single-stepping your way though? It might give you a better understanding of your code. That said . . .
Dim user As New clsLogin
If user.strUser_Type = "Administrator" Then
Why are you using user instead of All_Users(i)?
