我尝试为表单设置密码,并使用标签、文本框和确定按钮制作了一个新表单,但是当我在文本框中输入密码时,它说密码不正确,而密码正确..有什么问题?
public partial class Password : Form
{
private string password;
public Password()
{
InitializeComponent();
}
private void pass_TextChanged(object sender, EventArgs e)
{
string password = "mypass";
}
private void okButton_Click(object sender, EventArgs e)
{
if (passtextBox.Text == password)
{
list form = new list();
form.Show();
}
else
{
MessageBox.Show("Incorrect Password. Try Again!!");
}
}
}