首页 > 代码库 > C# 登录跳转

C# 登录跳转

private void Main_Load(object sender, EventArgs e) {
this.Hide(); // 隐藏自己
new FormLogin(this).Show(); // 打开登录窗体
}

private void tolNewStudent_Click(object sender, EventArgs e) {
NewStudent ns = new NewStudent();
ns.MdiParent = this;
ns.StartPosition = FormStartPosition.CenterScreen;
ns.Show();
}

private void tolNewTeacher_Click(object sender, EventArgs e) {
NewTeacher nt = new NewTeacher();
nt.MdiParent = this;
nt.StartPosition = FormStartPosition.CenterScreen;
nt.Show();
}

 


private void btnSubmit_Click(object sender, EventArgs e) {
u = new User(this.txtUserName.Text,this.txtPassWord.Text,this.cboUserType.Text);
if ("admin" == u.UserName && "admin" == u.PassWord) {
if (!("" == u.UserType)) {
flage = 1;
this.Close();
fForm.Show();
fForm.WindowState = FormWindowState.Maximized;

} else {
MessageBox.Show("请选择登录类型","类型提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
} else {
MessageBox.Show("用户名或密码不正确","登录失败",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}

C# 登录跳转