You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
130 lines
2.8 KiB
130 lines
2.8 KiB
#include "BOOKUI.h"
|
|
|
|
char first[2][20] = {"登陆","注册"};
|
|
char login_uesr[2][20] = {"普通用户登陆","管理员登陆"};
|
|
|
|
void Settitle(char *title)//设置控制台标题
|
|
{
|
|
SetConsoleTitle(title);
|
|
}
|
|
|
|
|
|
void setcolor(int forecolor,int bgcolor)
|
|
{
|
|
HANDLE win = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
SetConsoleTextAttribute(win,forecolor + bgcolor *0x10);
|
|
}
|
|
|
|
void setposition(int x,int y)
|
|
{
|
|
HANDLE win = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
COORD pos = {x,y+3};
|
|
SetConsoleCursorPosition(win,pos);
|
|
}
|
|
|
|
void showtitle()//显示标题
|
|
{
|
|
setposition(LB,0);
|
|
printf("--------------------------------------------------------------");
|
|
setposition(LB,1);
|
|
printf("|");
|
|
setposition(LB+25,1);
|
|
printf("学生选课系统");
|
|
setposition(LB+61,1);
|
|
printf("|");
|
|
setposition(LB,2);
|
|
printf("--------------------------------------------------------------");
|
|
int i;
|
|
for(i = 0; i < 8;i++){
|
|
setposition(LB,START+i);
|
|
printf("|");
|
|
setposition(LB+61,START+i);
|
|
printf("|");
|
|
}
|
|
setposition(LB,START+i);
|
|
printf("--------------------------------------------------------------");
|
|
}
|
|
|
|
void welcome()
|
|
{
|
|
int i,j = 0,k=-1;
|
|
for(i = 0; i <= 1;i++,k++)
|
|
{
|
|
if(choice == i)
|
|
setcolor(0,15);
|
|
setposition(LB+28,START+i+k+3);
|
|
printf("%s",first[j++]);
|
|
setcolor(11,0);
|
|
}
|
|
}
|
|
|
|
void comuser(int t)//用户登陆类型选择
|
|
{
|
|
int i,j = 0,k=-1;
|
|
for(i = 0; i <= 1;i++,k++)
|
|
{
|
|
if(t == i)
|
|
setcolor(0,15);
|
|
setposition(LB+25,START+i+k+3);
|
|
printf("%s",login_uesr[j++]);
|
|
setcolor(11,0);
|
|
}
|
|
}
|
|
|
|
void HideCursor() //隐藏光标
|
|
{
|
|
CONSOLE_CURSOR_INFO cursor_info = {1, 0};
|
|
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
|
|
}
|
|
|
|
|
|
void HideCursor2() //光标
|
|
{
|
|
CONSOLE_CURSOR_INFO cursor_info = {1, 1};
|
|
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
|
|
}
|
|
|
|
void clean()
|
|
{
|
|
printf(" ");
|
|
}
|
|
|
|
void player()
|
|
{
|
|
FILE *aim;
|
|
if((aim=fopen("aim.txt","r"))==NULL)
|
|
{
|
|
return;
|
|
}
|
|
char page[70][220];
|
|
int i,hang=60;
|
|
while(!feof(aim))
|
|
{
|
|
Sleep(33);
|
|
HideCursor();
|
|
for(i = 0; i < hang;i++)
|
|
{
|
|
fgets(page[i],209,aim);
|
|
|
|
}
|
|
for(i = 10; i < hang-8; i++)
|
|
{
|
|
printf("%s",page[i]+10);
|
|
}
|
|
setposition(0,-3);
|
|
}
|
|
system("cls");
|
|
int n = 10;
|
|
char size[50] = "mode con cols=180 lines=50";
|
|
while(n--)
|
|
{
|
|
int cols = (size[15]-'0')*10+size[16]-'0'-7;
|
|
int lines = (size[24]-'0')*10+size[25]-'0'-2;
|
|
size[15] = cols/10+'0';
|
|
size[16] = cols%10+'0';
|
|
size[24] = lines/10+'0';
|
|
size[25] = lines%10+'0';
|
|
system(size);
|
|
}
|
|
}
|