daveofgv
Well-known member
A very quick question that I have been having trouble finding.......
I need to have multiple users on a program and each one had there own login username and password.
I was thinking about using my.settings for the username/password such as "user1username, user1password, user2username, etc.....
How would my code look???
Right now, for one user I have
If I were to have several users would I put
Thanks
daveofgv
I need to have multiple users on a program and each one had there own login username and password.
I was thinking about using my.settings for the username/password such as "user1username, user1password, user2username, etc.....
How would my code look???
Right now, for one user I have
VB.NET:
Dim Response As Integer
If usernameTextBox1.Text = My.Settings.username1 AndAlso_
passwordTextBox2.Text.GetHashCode() = My.Settings.PasswordHashCode_ Then
Response = MessageBox.Show("You are now logged in. Welcome Back!", "My Program", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)If Response = vbOK ThenCopyrightScreen.Show()Me.Close() End IfElseMessageBox.Show("Wrong username or password")End If
VB.NET:
Dim Response As IntegerIf usernameTextBox1.Text = My.Settings.username1 AndAlso usernameTextBox1.Text = My.Settings.username2 AndAlso usernameTextBox1.Text = My.Settings.username3 AndAlso usernameTextBox1.Text = My.Settings.username4 AndAlso passwordTextBox2.Text.GetHashCode() = My.Settings.PasswordHashCode ThenResponse = MessageBox.Show("You are now logged in. Welcome Back!", "My Program", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)If Response = vbOK ThenCopyrightScreen.Show()Me.Close() End IfElseMessageBox.Show("Wrong username or password")
End If
daveofgv