NiCz

Login - Registration Form

Dec 27th, 2012
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.67 KB | None | 0 0
  1. 'NiCz Tutorials - NiCzRanara'
  2.  
  3. --
  4.  
  5. Rename the forms:
  6.  
  7. Form1 > Register
  8. Form2 > Login
  9. Form3 > Main
  10. Project Properties > Settings:
  11.  
  12. --
  13.  
  14. Project Properties > Settings:
  15. Username
  16. Password
  17.  
  18. --
  19.  
  20. Add the elements given below to "Register Form"
  21.  
  22. Textbox1 - for the Username
  23. Textbox2 - for the Password ( You can use Password Char if you want )
  24. Button1 - for the Confirmation of Registration
  25. Button2 - to go back to the 'Login Form'
  26.  
  27. --
  28.  
  29. Codes for "Registration Form" (Double-Click 'Confirm' Button)
  30.  
  31. My.Settings.Username = TextBox1.Text
  32.         My.Settings.Password = TextBox2.Text
  33.         My.Settings.Save()
  34.         MsgBox("You're account is now Registered.", MsgBoxStyle.Information, "Registration Successful!")
  35.         Main.Show()
  36.         Me.Close()
  37.  
  38. --
  39.  
  40. Add the elements given below to "Login Form"
  41.  
  42. Textbox1 - for the Username
  43. Textbox2 - for the Password ( You can use Password Char if you want )
  44. Button1 - to Login to the Program
  45. Button2 - to go to Register Form
  46. Button3 - to Exit the Program
  47.  
  48. --
  49.  
  50. Codes for "Login Form" (Double-Click 'Login' Button)
  51.  
  52. If TextBox1.Text = My.Settings.Username And TextBox2.Text = My.Settings.Password Then
  53.             MsgBox("You're now logged in.", MsgBoxStyle.Information, "Now Logged In")
  54.             Main.Show()
  55.             Me.hide()
  56.         End If
  57.  
  58. --
  59.  
  60. Login Form - Registration Button (Double-click 'Register' Button)
  61.  
  62. Register.show
  63. Me.hide
  64.  
  65. --
  66.  
  67. Code for the Exit button on Login Form (Double-click 'Exit' Button)
  68.  
  69. Me.close
  70.  
  71. --
  72.  
  73. Code for the Exit button on Register Form (Double-click 'Exit' Button)
  74.  
  75. Login.Show
  76. Me.hide
  77.  
  78. 'Thank you for watching and using this code - NiCzRanara - NiCz Tutorials'
Advertisement
Add Comment
Please, Sign In to add comment