Login System (No MySql Etc)
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
Hey guys
today im going to show you how to make a login system in visual basic 2008, first open visual basic 2008 and start a new project, call it whatever you want then get 2 labels, 2 buttons and 2 textboxes, name and place them like so (if you want you can change the form name and edit it etc)
http://img697.imageshack.us/img697/6695/54607786.png
then goto "Project" then "Add Windows Form..." and call that whatever you want, then add 2 labels, 1 button and 2 textboxes then name and place them like so
http://img502.imageshack.us/img502/5562/12020193.png
now double click the form2 register button and enter this code
today im going to show you how to make a login system in visual basic 2008, first open visual basic 2008 and start a new project, call it whatever you want then get 2 labels, 2 buttons and 2 textboxes, name and place them like so (if you want you can change the form name and edit it etc)
http://img697.imageshack.us/img697/6695/54607786.png
then goto "Project" then "Add Windows Form..." and call that whatever you want, then add 2 labels, 1 button and 2 textboxes then name and place them like so
http://img502.imageshack.us/img502/5562/12020193.png
now double click the form2 register button and enter this code
Code: Select all
now goto the form1 login button and enter this codeIf My.Computer.FileSystem.DirectoryExists("C:\LoginInfo\") Then
Else
MkDir("C:\LoginInfo\")
End If
If My.Computer.FileSystem.DirectoryExists("C:\LoginInfo\" + TextBox1.Text) Then
MsgBox("Error - account already exists", MsgBoxStyle.Critical)
Else
MkDir("C:\LoginInfo\" + TextBox1.Text)
Dim a As New System.IO.StreamWriter("C:\LoginInfo\" + TextBox1.Text + "\Username.txt")
a.WriteLine(TextBox1.Text)
a.Close()
Dim b As New System.IO.StreamWriter("C:\LoginInfo\" + TextBox1.Text + "\Password.txt")
b.WriteLine(TextBox2.Text)
b.Close()
MsgBox("Account created")
End If
Code: Select all
now goto the form register button and enter this codeTry
Dim sa As String
Dim sb As String
Dim a As New System.IO.StreamReader("C:\LoginInfo\" + TextBox4.Text + "\Username.txt")
sa = a.ReadLine()
a.Close()
Dim b As New System.IO.StreamReader("C:\LoginInfo\" + TextBox3.Text + "\Password.txt")
sb = b.ReadLine()
b.Close()
If TextBox4.Text = sa.ToString Then
If TextBox3.Text = sb.ToString Then
MsgBox("Welcome " + sa.ToString)
Form2.Show()
Else
MsgBox("Error - password incorrect")
End If
Else
MsgBox("Error - account does not exist")
End If
Catch ex As Exception
MsgBox("Error - " + ex.Message)
End Try
Code: Select all
and it should now work thank you for viewing my tutorialForm2.show
Last edited by ManMega1 on Thu Apr 22, 2010 3:48 pm, edited 1 time in total.
manmega1 did u see my one i did
WaynesWorld2010 wrote:manmega1 did u see my one i didno i dont think i did, sorry
hi I been reading other websites tutorials on this but all they can do is either make it look hard or use mySQL, you though, how the hell do you do it?! You make it look so easy XD, Thanks for the tut, rep button pressed and gratitude given
Thanks, John
Thanks, John

rocky4126 wrote:hi I been reading other websites tutorials on this but all they can do is either make it look hard or use mySQL, you though, how the hell do you do it?! You make it look so easy XD, Thanks for the tut, rep button pressed and gratitude giventhanks, that means a lot, to do this i found it quite easy,
Thanks, John

hey, this doesnt work for me, i put put everything then i make an account and it says its been created and i try to login it says error- account is not created. but then when i remake the account it says its already made.
any help?
any help?
graves wrote:hey, this doesnt work for me, i put put everything then i make an account and it says its been created and i try to login it says error- account is not created. but then when i remake the account it says its already made.Hmm, not sure why, works for everyone else (including me) try re-check to see if you have put all the correct coding in the right place cooll;
any help?
Hey graves
hmm, weird, i'm sure it works for me, but if i find a problem, i will update the code, it is case sensetives
e.g. Username: "graves" Password: "graves"
hmm, weird, i'm sure it works for me, but if i find a problem, i will update the code, it is case sensetives
e.g. Username: "graves" Password: "graves"
Copyright Information
Copyright © Codenstuff.com 2020 - 2023