0

Now i want to check whether the windows user entering the correct password or not .
for example:
in textbox1=username
in textbox2=password
onclicking the ok button if it is the right password to that user or not,if it is valid user means in messagebox("valid user") else invalid user.how to i check this...Help me..

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by __avd
0

You have to check the values of textboxes against preload data of user. If user's data is in database, you have to use ADO.NET classes.

0

For example, if the password was "abcd123"
You would use this:

if(this.textBox2.Text = "abcd123")
{
             MessageBox.Show("Valid user");
}
else
{
           MessageBox.Show("Invalid user");
}

Hope this helps :P

0

For example, if the password was "abcd123"
You would use this:

if(this.textBox2.Text = "abcd123")
{
             MessageBox.Show("Valid user");
}
else
{
           MessageBox.Show("Invalid user");
}

Hope this helps :P

No, code has an error.

if(this.textBox2.Text == "abcd123")
{
             MessageBox.Show("Valid user");
}
else
{
           MessageBox.Show("Invalid user");
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.