Advertisement
Suddendox

[VB .NET] Login and Register Code

Dec 24th, 2018
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.76 KB | None | 0 0
  1. '[VB .NET] Login and Register Code
  2. 'Made by Suddendox https://www.youtube.com/channel/UCjNerdkHqrHYwhQ37TZCllA
  3. 'https://selly.gg/@Doxx
  4.  
  5. 'https://selly.gg/p/c8fb0574
  6.  
  7. Public Class Form1
  8. 'https://selly.gg/p/c8fb0574
  9.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  10.         'Login Button
  11.         If TextBox1.Text = "" Or TextBox2.Text = "" Then
  12.             MsgBox("Cannot be blank!") 'https://selly.gg/p/c8fb0574
  13.         Else
  14.             If TextBox1.Text = My.Settings.username And
  15.             TextBox2.Text = My.Settings.password Then
  16.                 'Login successfully 'https://selly.gg/p/c8fb0574
  17.                 MsgBox("Welcome, " + TextBox1.Text)
  18.             Else
  19.                 MsgBox("Invalid username and/or password.")
  20.             End If
  21.         End If
  22.     End Sub
  23. 'https://selly.gg/p/c8fb0574
  24.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  25.         'Register Button
  26.         If My.Settings.username = "" Or My.Settings.password = "" Then
  27.             My.Settings.username = TextBox1.Text.ToString()
  28.             My.Settings.password = TextBox2.Text.ToString()
  29.             My.Settings.Save()
  30.             MsgBox("Account Created!")
  31.         Else
  32.             MsgBox("You have already created an account.") 'https://selly.gg/p/c8fb0574
  33.         End If
  34.     End Sub
  35. 'https://selly.gg/p/c8fb0574
  36.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  37.         If My.Settings.username = "" Or My.Settings.password = "" Then
  38.             Button2.Visible = True
  39.         Else
  40.             'If they have already created an account, then hide the register button.
  41.             Button2.Visible = False
  42.         End If
  43.     End Sub
  44. End Class
  45. 'https://selly.gg/p/c8fb0574
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement