没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论











学生管理系统源码
1、注册
/*
注册主要逻辑
*/QString id = ui->line_id->text();
QString password = ui->line_password->text();
QString password2 = ui->line_password2->text();
if (id == nullptr) {
QMessageBox::warning(this, " ", "您的用户名为空!");
} else if (id.length() < 6) {
QMessageBox::warning(this, " ", "您的用户名小于六位!");
} else if (password == nullptr) {
QMessageBox::warning(this, " ", "您的密码为空!");
} else if (password.length() < 6) {
QMessageBox::warning(this, " ", "您的密码小于六位!");
} else if (password != password2) {
QMessageBox::warning(this, " ", "两次密码不一致!");
} else {
LinkList *P = R;
while (P->next != nullptr) {
if (P->next->Id == id) {
QMessageBox::warning(this, " ", "存在当前用户名");
return;
}
P = P->next;
}

if (!ui->Btn_Student->isChecked() && !ui->Btn_Teacher->isChecked()) {
QMessageBox::warning(this, " ", "请选择您的用户类型");
} else if (ui->Btn_Student->isChecked()) {
LinkList *L = new LinkList;
L->Id = id;
L->Password = password;
L->IsTeacher = false;
L->next = R->next;
R->next = L;
if (QMessageBox::Ok ==
QMessageBox::information(this, " ", "学生用户注册成功", QMessageBox::Ok
| QMessageBox::Cancel)) {
Register::close();
} else {
Register::close();
}
} else if (ui->Btn_Teacher->isChecked()) {
LinkList *L = new LinkList;
L->Id = id;
L->Password = password;
L->IsTeacher = true;
L->next = R->next;
R->next = L;
if (QMessageBox::Ok == QMessageBox::information(this, " ", "教师用户注册成功",
QMessageBox::Ok | QMessageBox::Cancel)) {
Register::close();
} else {
Register::close();
}
}
}
2、登录页面,会根据输入的用户名自动判断是进入学生页面还是教师
页面

/*
登录主要逻辑
*/if (ui->text_line->text() == nullptr) {
QMessageBox::warning(this, "", "您的用户名为空!");
} else if (ui->password_line_2->text() == nullptr) {
QMessageBox::warning(this, "", "您的密码为空!");
} else {
LinkList *p = &L;
if (p->next == nullptr) {
QMessageBox::warning(this, "", "找不到用户名!");
}
while (p->next != nullptr) {
if (p->next->Id == ui->text_line->text()) {
if ((p->next->Password == ui->password_line_2->text())
&& !p->next->IsTeacher) {
if (QMessageBox::Ok ==
QMessageBox::information(this, "", "登录成功", QMessageBox::Ok,
QMessageBox::Cancel)) {
RankingList *R = new RankingList;
R->show();
this->close();
return;
} else {
RankingList *R = new RankingList;
R->show();
this->close();
return;
}
} else if ((p->next->Password == ui->password_line_2->text()) &&
p->next->IsTeacher) {
剩余11页未读,继续阅读
资源评论

Andy&lin
- 粉丝: 33
- 资源: 53

上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制
