How do I recognize a wrong password ?
-
I'm making a school project, and in the beginning of the project i have "Register " and " Continue as Guest " so after registering, another form will open, that will require the password and the username created before. The problem is that it wont recognize if i write a wrong password or username, it will continue anyway...hope you can give me a hand, thank you ;)
-
I'm making a school project, and in the beginning of the project i have "Register " and " Continue as Guest " so after registering, another form will open, that will require the password and the username created before. The problem is that it wont recognize if i write a wrong password or username, it will continue anyway...hope you can give me a hand, thank you ;)
You obviously have a problem with your logic but since you didn't show any of the relevant code, it's impossible to tell you what you did wrong.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
You obviously have a problem with your logic but since you didn't show any of the relevant code, it's impossible to tell you what you did wrong.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiakyou dont need to be rude ;) I just started learning this.. what I have is this : If TextBox1.Text*this is the username* = Form2.TextBox2.Text And TextBox2.Text*this is the password" = Form2.TextBox3.Text Then MsgBox("Login succeeded") Form4.Show() Me.Hide() Else MsgBox("Wrong user/password, try again") End If
-
you dont need to be rude ;) I just started learning this.. what I have is this : If TextBox1.Text*this is the username* = Form2.TextBox2.Text And TextBox2.Text*this is the password" = Form2.TextBox3.Text Then MsgBox("Login succeeded") Form4.Show() Me.Hide() Else MsgBox("Wrong user/password, try again") End If
I just find it amazing that people don't know how to ask questions. Just saying "my code doesn't work" and not providing any context or description of what was done just wastes time. This happens several dozen times per day. In your case, you code is assuming there are two forms. The first is one where a user logs into the application and the second is where the username and password are being stored. This is NOT standard at all. You normally don't store usernames and passwords in forms. They are normally stored in databases, and in the case of school projects, plain text files. You might want to think about giving descriptive names to your forms and controls. Leaving them with the default names of "TextBox5" doesn't help because you have no idea what that text box is used for. The problem you're having is that you're simply comparing the wrong strings to each other and not coming up with a match.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak