我想使用一个命令,它将在一个"If"中包含两个"textboxes.Text".我的意思是当我执行此命令时:
If (textBox1.Text == ("admin")) + (textBox2.Text == ("admin))或者这 If (textBox1.Text == ("admin) , textBox2.Text == admin)) 是不对的.
主要代码是:
private void Label_Click(object sender, EventArgs e)
{
if (textBox2.Text == ("admin")) + (textBox1.Text == ("admin"))
{
Label.Text = "right";
}
else
{
Label.Text = "wrong";
errorProvider1.SetError(errorprovider, "Wrong Username or Password");
}
Run Code Online (Sandbox Code Playgroud)
即我想要做的是,如果两个文本框中的一个是错误的,标签将显示密码或用户名是错误的...任何想法?
c# ×1