Skip to content

Regarding username and password ,by putting some controls

Santhi G

Asked Feb 1, 2006, 1:16 AM EST1 answer
Share
LinkedInX
Am putting some 3 textboxes, 1 checkbox and 1 button.If we click the button, the username(textbox1) and password(textbox2) is correct, then it displays in another textbox(textbox3) as " WELCOME" and checkbox should also checked. Otherwise, it displays in textbox3 as "u r not the correct user" and the checkbox should not be checked.
 
   plz send the code as soon as possible.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    if (textbox1.Text == "TheRealUserName" && textbox2.Text == "TheRealPassword")
    {
    textbox3.Text = "WELCOME";
    checkbox1.Checked = true;
    }
    else
    {
    textbox3.Text = "Invalid username/password";
    checkbox1.Checked = false;
    }


    PS: You should consider reading a book ;)

    Simon
    0