// 记录登陆用户名和登陆类型
UserHelper.loginId = txtLoginId.Text;
UserHelper.loginType = cboLoginType.Text;
switch (cboLoginType.Text )
{
case "教师":
// 如果是教师,转到教师窗体
TeacherForm teacherForm = new TeacherForm();
teacherForm.Show();
this.Visible = false;
break;
case "学生":
// 如果是学生,转到学生窗体
StudentForm studentForm = new StudentForm();
studentForm.Show();
this.Visible = false;
break;
}
}
else // 验证合法用户失败,给出提示
{
MessageBox.Show(message,"登陆提示",
MessageBoxButtons.OK,MessageBoxIcon.Warning);
} C#高职计算机导论考试系统设计与实现(15):http://www.751com.cn/jisuanji/lunwen_181.html