this is where the user creates his username & password:
Code:
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim temppassword1 As String
Dim temppassword2 As String
Dim password As String = My.Settings.Password
Dim username As String = My.Settings.Username
temppassword1 = password.Text
temppassword2 = confirmpassword.Text
If Not password = ("") Then
login.Show()
Me.Close()
End
End If
If password = ("") Then password = confirmpassword.Text
If username.Text = ("") Then
MsgBox("Please create a Username!")
End If
If confirmpassword.Text = ("") Or confirmpassword.Text = ("") Then
MsgBox("Please create a Password!")
End If
If Not temppassword1 = temppassword2 Then
MsgBox("Error! Passwords do not match")
End If
username = username.Text
password = confirmpassword.Text
login.Show()
Me.Close()
End Sub
End Class
then we create the actual login prompt:
Code:
Public Class login
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Pass.Click
If TextBox1.Text = (My.Settings.Password) Then
MsgBox("Access Granted!")
'Do Something
End
Else
MsgBox("Access Denied!")
End If
End Sub
Private Sub login_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
label2.text = ("Welcome " & My.Settings.Username & ", Please enter your password!")
End Sub
End Class
And now you're done, Enjoy!