Advanced Login System
Posted: Sat Oct 24, 2009 8:20 pm
He guys
today i gonna show you guys how to make a advanced login system
whe need 3 forms
What whe need in form1 is
2 labels: label1 = username label2= password
2 textboxes: 1 is for username 2 for password
3 buttons: button1 = login button2 = create a user button 3 = exit
this is the hole code for form1:
2 labels: label 1 for username label 2for password
2 textboxes: 1 is for username 2 for password
1 button: Creates the user
the hole code for form2:
is just your one that is gonna show if your logd in
today i gonna show you guys how to make a advanced login system
whe need 3 forms
What whe need in form1 is
2 labels: label1 = username label2= password
2 textboxes: 1 is for username 2 for password
3 buttons: button1 = login button2 = create a user button 3 = exit
this is the hole code for form1:
Code: Select all
what whe need for form2 is:Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
MsgBox("ERROR,YOU NEED AT LEAST ONE LETTER", MsgBoxStyle.Critical)
Else
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
If TextBox2.Text = "" Then
MsgBox("error,PLEASE INPUT A PASSWORD", MsgBoxStyle.Critical)
Else
If PASSLINE = PASSREAD.ReadLine() = True Then
MsgBox("Youre Logd in " + TextBox1.Text)
Form3.show()
End If
End If
Else
MsgBox("THE USERNAME DONT EXIT", MsgBoxStyle.Critical)
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form2.show()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
2 labels: label 1 for username label 2for password
2 textboxes: 1 is for username 2 for password
1 button: Creates the user
the hole code for form2:
Code: Select all
And Form3 Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If My.Computer.FileSystem.DirectoryExists(" C:\ACCOUNTS\") = True Then
Else
End If
If TextBox1.Text = "" Then
MsgBox("ERROR,YOUR ACCOUNT MUST HAVE ONE LETTER IN IT", MsgBoxStyle.Critical)
Else
End If
If TextBox2.Text = "" Then
MsgBox("ERROR,PLEASE INSERT A PASSWORD", MsgBoxStyle.Critical)
Else
MkDir("C:\ACCOUNTS\" + TextBox1.Text)
Dim username As New System.IO.StreamWriter("C:\ACCOUNTS\" + TextBox1.Text + "\" + "username.txt")
username.Write(TextBox1.Text)
username.Close()
Dim password As New System.IO.StreamWriter("C:\ACCOUNTS\" + TextBox1.Text + "\" + "password.txt")
password.Write(TextBox2.Text)
password.Close()
MsgBox("ACCOUNT CREATED", MsgBoxStyle.Information, "ACCOUNT CREATED")
Me.Hide()
Form1.Show()
End If
End Sub
End Class
is just your one that is gonna show if your logd in