[VB0.9] Advanced Login System [VB9.0]
You need:
Code:
button1
button2
tabcontrol1
textbox1
textbox2
textbox3
textbox4
label1
label2
label3
label4
Fill on the create button in (button1):
Code:
IfMy.Computer.FileSystem.DirectoryExists("C:\project\database\users\") Then
Else
MkDir("C:\project\database\users\")
EndIf
IfMy.Computer.FileSystem.DirectoryExists("C:\project\database\users\" + TextBox1.Text + "\") = TrueThen
MsgBox("Error this account is already in use!", MsgBoxStyle.Critical)
Else
If TextBox1.Text = ""Then
MsgBox("Error fill a username in", MsgBoxStyle.Critical)
Else
If TextBox2.Text = ""Then
MsgBox("Error fill a password in", MsgBoxStyle.Critical)
Else
MkDir("C:\project\database\users\" + TextBox1.Text)
Dim username AsNew System.IO.StreamWriter("c:\project\database\users\" + TextBox1.Text + "\" + "username.txt")
username.Write(TextBox1.Text)
username.Close()
Dim password AsNew System.IO.StreamWriter("c:\project\database\users\" + TextBox1.Text + "\" + "password.txt")
password.Write(TextBox2.Text)
password.Close()
MsgBox("Yeahh.. you register is finished", MsgBoxStyle.Information)
EndIf
EndIf
EndIf
and by the login button (button2):
Code:
If TextBox4.Text = ""Then
MsgBox("Error fill a username in", MsgBoxStyle.Critical)
Else
IfMy.Computer.FileSystem.DirectoryExists("c:\project\database\users\" + TextBox4.Text + "\") Then
Dim Userread As System.IO.StreamReader = New System.IO.StreamReader("c:\project\database\users\" + TextBox4.Text + "\" + "username.txt")
Dim Userline AsString
Dim Passread As System.IO.StreamReader = New System.IO.StreamReader("c:\project\database\users\" + TextBox4.Text + "\" + "password.txt")
Dim Passline AsString
Do
Passline = TextBox3.Text
Userline = Userread.ReadLine()
Console.WriteLine(passline)
Console.WriteLine(userline)
LoopUntil userline IsNothing
If TextBox3.Text = ""Then
MsgBox("Error Fill a password in", MsgBoxStyle.Critical)
Else
If Passline = Passread.ReadLine() = TrueThen
MsgBox("Welcome! Your logged in!", MsgBoxStyle.Information)
Form2.Show()
Me.Hide()
EndIf
EndIf
Else
MsgBox("Error Your username is wrong!", MsgBoxStyle.Critical)
EndIf
EndIf
and than the labels :
Code:
label1 text = Username
label2 text = Password
label3 text = Username
label4 text = Password
and the tabpages:
Code:
tabpage1 text = Create account
tabpage2 text = Login
and textboxen (passwords):
Code:
PrivateSub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
TextBox3.PasswordChar() = "*"
EndSub
PrivateSub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
TextBox2.PasswordChar() = "*"
EndSub
CREDITS
Me, Floppy productions coder team
Re: [VB0.9] Advanced Login System [VB9.0]
Easy enough for me but for a noob, - I wouldnt know where to but the buttons labels Etc.. Pics would be nice
Re: [VB0.9] Advanced Login System [VB9.0]
This tutorial has been seen before, Are you sure you did this, NOS-Hotel?
if not, give credit to the orginal author.
Re: [VB0.9] Advanced Login System [VB9.0]
What is vb 0.9 and vb 9? if its for VB8 then there are errors in the code, for VB 2008 Code edit for Create and login button:
Code:
If My.Computer.FileSystem.DirectoryExists("C:\project\database\users\") Then
Else
MkDir("C:\project\database\users\")
End If
If My.Computer.FileSystem.DirectoryExists("C:\project\database\users\" + TextBox1.Text + "\") = True Then
MsgBox("Error this account is already in use!", MsgBoxStyle.Critical)
Else
If TextBox1.Text = ""Then
MsgBox("Error fill a username in", MsgBoxStyle.Critical)
Else
If TextBox2.Text = ""Then
MsgBox("Error fill a password in", MsgBoxStyle.Critical)
Else
MkDir("C:\project\database\users\" + TextBox1.Text)
Dim username As New System.IO.StreamWriter("c:\project\database\users\" + TextBox1.Text + "\" + "username.txt")
username.Write(TextBox1.Text)
username.Close()
Dim password As New System.IO.StreamWriter("c:\project\database\users\" + TextBox1.Text + "\" + "password.txt")
password.Write(TextBox2.Text)
password.Close()
MsgBox("Yeahh.. you register is finished", MsgBoxStyle.Information)
End If
End If
End if
There Are errors everywhere
"EndIf = End if"
"ifmy = If My"
"Truethen = True Then"
Re: [VB0.9] Advanced Login System [VB9.0]
Why not release the source; but good anyway :good: