该系统使用easyx插件。
以下是部分页面
以下是部分源码,需要源码的私信
#define _CRT_SECURE_NO_WARNINGS 1//vs的取消报警
#include<easyx.h>
#include<stdio.h>
#include<stdlib.h>
#define width 1280
#define height 840
#define font_w 35 //字体宽度
#define font_h 90 //字体高度
#define Max_person 100
typedef struct
{
char name[50];
char id[50];
char sex[50];
char age[50];
char department[50];//
char major[50];
char title[50];
}Teacher;//教师
Teacher teacher[Max_person];
int count_teacher = 0;//记录老师数量
typedef struct
{
char name[50];
char id[50];
char sex[50];
char age[50];
char lab[50];
char job[50];
}Experimenter;//实验人员
int count_exper = 0;
Experimenter exper[Max_person];
typedef struct
{
char name[50];
char id[50];
char sex[50];
char age[50];
char politics[50];
char title[50];
}Staff;//行政人员
int count_staff = 0;
Staff staff[Max_person];
typedef struct
{
char name[50];
char id[50];
char sex[50];
char age[50];
char department[50];//
char politics[50];
char major[50];
char title[50];
}Teacher_Adm;//教师兼行政人员
int count_tadm = 0;
Teacher_Adm teacher_adm[Max_person];
int Choose_NUmber()//构造一个选择函数--后期只需要进行调用即可
{
HWND hwnd = GetHWnd();
while (1)
{
char input[15];
InputBox(input, 15, "输入你的选择", "选择", 0, 0, 0, false);
int numb_input = atoi(input);//将字符转为整形
if (numb_input == 1)
{
return 1;
}
else if (numb_input == 2)
{
return 2;
}
else if (numb_input == 3)
{
return 3;
}
else if (numb_input == 4)
{
return 4;
}
else if (numb_input == 5)
{
return 5;
}
else if (numb_input == 6)
{
return 6;
}
else if (numb_input == 0)
{
return 0;
}
else
{
MessageBox(hwnd, "输入错误\n重新输入", "提示", MB_OK);
}
}
}
int choose_buffer()//用于调用阻塞选择
{
while (1)//自带缓冲
{
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)//按下esc键,退出程序
{
return 0;
}
else if ((GetAsyncKeyState(VK_SHIFT) & 0x8000) && (GetAsyncKeyState('X') & 0x8000))//上一页
{
return 1;
}
else if ((GetAsyncKeyState(VK_SHIFT) & 0x8000) && (GetAsyncKeyState('X') & 0x8000))//下一页
{
return 2;
}
}
}
int Initial_person()
{
FILE* fpt = fopen("./teacher.txt", "r");
FILE* fps = fopen("./staff.txt", "r");
FILE* fpe = fopen("./exper.txt", "r");
FILE* fpd = fopen("./teacher_adm.txt", "r");
if (!fpt)//出现一个打不开就进行报错
{
printf("文件打开失败\n");
return 0;
}
if (!fps)
{
printf("文件打开失败\n");
return 0;
}
if (!fpe)
{
printf("文件打开失败\n");
return 0;
}
if (!fpd)
{
printf("文件打开失败\n");
return 0;
}
int i = 0;
while (fscanf(fpt, "%s%s%s%s%s%s%s", teacher[i].name, teacher[i].id, teacher[i].age, teacher[i].sex, teacher[i].department, teacher[i].major, teacher[i].title) != EOF)
{
i++;
}
count_teacher = i;
i = 0;
while (fscanf(fpe, "%s%s%s%s%s%s", exper[i].name, exper[i].id, staff[i].age, exper[i].sex, exper[i].lab , exper[i].job ) != EOF)
{
i++;
}
count_staff = i;
i = 0;
while (fscanf(fps, "%s%s%s%s%s%s", staff[i].name, staff[i].id, staff[i].age, staff[i].sex, staff[i].politics, staff[i].title) != EOF)
{
i++;
}
count_exper = i;
i = 0;
while (fscanf(fpd, "%s%s%s%s%s%s%s%s", teacher_adm[i].name, teacher_adm[i].id, teacher_adm[i].age, teacher_adm[i].sex, teacher_adm[i].department , teacher_adm[i].major , teacher_adm[i].politics , teacher_adm[i].title ) != EOF)
{
i++;
}
count_tadm = i;
fclose(fpt);
fclose(fps);
fclose(fpe);
fclose(fpd);
return 0;
}
int Updata_File()
{
FILE* fpt = fopen("./teacher.txt", "w+");
FILE* fps = fopen("./staff.txt", "w+");
FILE* fpe = fopen("./exper.txt", "w+");
FILE* fpd = fopen("./teacher_adm.txt", "w+");
if (!fpt)//出现一个打不开就进行报错
{
printf("文件打开失败\n");
return 0;
}
if (!fps)
{
printf("文件打开失败\n");
return 0;
}
if (!fpe)
{
printf("文件打开失败\n");
return 0;
}
if (!fpd)
{
printf("文件打开失败\n");
return 0;
}
int i = 0;
while (i < count_teacher)
{
fprintf(fpt, "%s %s %s %s %s %s %s\n", teacher[i].name, teacher[i].id, teacher[i].age, teacher[i].sex, teacher[i].department, teacher[i].major, teacher[i].title);
i++;
}
i = 0;
while (i < count_exper)
{
fprintf(fpe, "%s %s %s %s %s %s\n", exper[i].name, exper[i].id, staff[i].age, exper[i].sex, exper[i].lab, exper[i].job);
i++;
}
i = 0;
while (i < count_staff)
{
fprintf(fps, "%s %s %s %s %s %s\n", staff[i].name, staff[i].id, staff[i].age, staff[i].sex, staff[i].politics, staff[i].title);
i++;
}
i = 0;
while (i < count_tadm)
{
fprintf(fpd, "%s %s %s %s %s %s %s %s\n", teacher_adm[i].name, teacher_adm[i].id, teacher_adm[i].age, teacher_adm[i].sex, teacher_adm[i].department, teacher_adm[i].major, teacher_adm[i].politics, teacher_adm[i].title);
i++;
}
fclose(fpt);
fclose(fps);
fclose(fpe);
fclose(fpd);
return 0;
}