VB.NET - Advanced Login System


SUBMITTED BY: Guest

DATE: Oct. 25, 2013, 2:41 p.m.

FORMAT: Text only

SIZE: 2.0 kB

HITS: 1064

  1. Hello Today Im Gona Show You How To Make A Advanced Login System:
  2. Form1
  3. Button1 Text: Login
  4. Button2 Text: Sign Up
  5. 2 Textboxes
  6. Form2
  7. 2 textboxes
  8. Button1 Text: Create Account
  9. Button2 Text: Cancel
  10. Form3
  11. Anything You Wan
  12. Form1 Codes:
  13. Loigin Code:
  14. If My.Computer.FileSystem.DirectoryExists(" C:ACCOUNTS" + TextBox1.Text + "") Then
  15. Dim USERREAD As System.IO.StreamReader = New System.IO.StreamReader("C:ACCOUNTS" + TextBox1.Text + "" + "USERNAME.TXT")
  16. Dim userline As String
  17. Dim PASSREAD As System.IO.StreamReader = New System.IO.StreamReader("C:ACCOUNTS" + TextBox1.Text + "" + "PASSWORD.TXT")
  18. Dim PASSLINE As String
  19. Do
  20. PASSLINE = TextBox2.Text
  21. userline = USERREAD.ReadLine
  22. Console.WriteLine(PASSLINE)
  23. Console.WriteLine(userline)
  24. Loop Until userline Is Nothing
  25. If TextBox2.Text = "" Then
  26. MsgBox("error, PLEASE INPUT A PASSWORD", MsgBoxStyle.Critical)
  27. Else
  28. If PASSLINE = PASSREAD.ReadLine() = True Then
  29. Form3.Show()
  30. End If
  31. End If
  32. Else
  33. MsgBox("THE USERNAME DONT EXIT", MsgBoxStyle.Critical)
  34. End If
  35. Sign Up Button:
  36. Form2.show
  37. Form2 Codes:
  38. Create Account Code:
  39. If TextBox1.Text = "" Then
  40. MsgBox("ERROR,Your Account/Username must have one letter in it!", MsgBoxStyle.Critical)
  41. Else
  42. If TextBox2.Text = "" Then
  43. MsgBox("ERROR,Your Account/Password must have one letter in it!", MsgBoxStyle.Critical)
  44. Else
  45. MkDir("C:ACCOUNTS" + TextBox1.Text)
  46. Dim username As New System.IO.StreamWriter("C:ACCOUNTS" + TextBox1.Text + "" + "username.txt")
  47. username.Write(TextBox1.Text)
  48. username.Close()
  49. Dim password As New System.IO.StreamWriter("C:ACCOUNTS" + TextBox1.Text + "" + "password.txt")
  50. password.Write(TextBox2.Text)
  51. password.Close()
  52. MsgBox("ACCOUNT CREATED", MsgBoxStyle.Information, "ACCOUNT CREATED")
  53. End If
  54. End If
  55. Cancel Button Code:
  56. form2.close
  57. Add Form3

comments powered by Disqus