C# Windows窗体应用(1)

登录界面:点击登录按钮,跳转下一个页面

private void button1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            Form2 f2 = new Form2();
            f2.ShowDialog();
        }


输入对应的账号和密码登录

if ((textBox1.Text == "123456") & (textBox2.Text == "654321"))
            {
                MessageBox.Show("登陆成功!");
                this.Visible = false;
                Form2 f2 = new Form2();
                f2.ShowDialog();
            }
            else
            {
                MessageBox.Show("账号或密码错误,请重新输入!");
            }


登录密码输入后显示为对应的字符,如“*”:

在 textBox的行为属性中的PasswordChar设置

猜你喜欢

转载自blog.csdn.net/c_hydar/article/details/78925838