C# 采用了0个方法重载? 简单问题 !!
privatevoidbtnSubmit_Click(objectsender,EventArgse){if(txtName.Text==""){MessageBox.S...
private void btnSubmit_Click(object sender, EventArgs e)
{
if (txtName.Text == "")
{
MessageBox.Show("用户名不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (txtPwd.Text == "")
{
MessageBox.Show("密码不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (txtName.Text == "admin" && txtPwd.Text == "123" && cmbType.Text == "管理员")
{
MessageBox.Show("登录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
ShowForm();
}
else if (cmbType.Text == "")
{
MessageBox.Show("类型不能为空!", "提示,", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
//退出
private void btnCannal_Click(object sender, EventArgs e)
{
Application.Exit();
}
//方法 :窗体跳转
private void ShowForm(object sender, EventArgs e)
{
//实例化教员窗体
TeacherForm teacherForm = new TeacherForm();
//窗体跳转
teacherForm.Show();
//本窗体隐藏
this.Visible = false; 展开
{
if (txtName.Text == "")
{
MessageBox.Show("用户名不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (txtPwd.Text == "")
{
MessageBox.Show("密码不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (txtName.Text == "admin" && txtPwd.Text == "123" && cmbType.Text == "管理员")
{
MessageBox.Show("登录成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
ShowForm();
}
else if (cmbType.Text == "")
{
MessageBox.Show("类型不能为空!", "提示,", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
//退出
private void btnCannal_Click(object sender, EventArgs e)
{
Application.Exit();
}
//方法 :窗体跳转
private void ShowForm(object sender, EventArgs e)
{
//实例化教员窗体
TeacherForm teacherForm = new TeacherForm();
//窗体跳转
teacherForm.Show();
//本窗体隐藏
this.Visible = false; 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询