?? login.c
字號:
int Login()
{ /*設置進入界面*/
char back[43*9*2],buf0[23*2],
buf1[23*2],check[14],now_enter;
int i,j=0,k=0,l=0,x,y,
hlepx,helpy,helpi=0,msx,msy,msz;
int slect=0;
struct date d;
struct time t;
char *help[]={"\r\n Welcome To Our System!\r\n","\r\n * My name is Gaojie.","\r\n Other Number:Wangyu Dongli","\r\n My QQ : 909861843",
"\r\n Our teacher: Professor Han","\r\n\n * Press \" Esc \" to quit at any time ...",
"\r\n ","\r\n * You can move mouse over me to stop rolling..."};
getdate(&d);
window(1,1,80,25);
textbackground(2);
clreol();/*在文本窗口中清除字符到行末*/
gotoxy(1,25);
clreol();
window(1,2,80,24);
textbackground(1);
clrscr();
window(10,4,70,21);
textbackground(6);
clrscr();/* 主界面*/
textcolor(15);
cprintf("\r\n ");
cprintf("\r\n Welcome to our system");
gettext(10,6,32,6,buf0);/* 保存那行運動的字符*/
window(11,6,69,20);
textbackground(2);
clrscr();
textcolor(14);
cprintf("\r\n The Demo System Of OS\r\n");
gotoxy(49,6);
textcolor(10);
cprintf("%d.%2d.%2d",d.da_year,d.da_mon,d.da_day);
textbackground(15);
gettext(45,11,55,11,buf1);/* 保存左右擺動的長條*/
textbackground(2);
gotoxy(36,6);
cprintf(" ");/* 此處顯示當前時間*/
window(14,9,42,19);
textbackground(5);
clrscr();
window(15,10,41,18);
My_setcolor(9,0);
clrscr();
cputs(help[0]);
My_setcolor(2,0);
cprintf("%s%s%s%s",help[1],help[2],help[3],help[4],help[5]);
hlepx=wherex();
helpy=wherey();
gettext(19,10,61,18,back);
for(i=0;;)
{
Showmouse();
do{
Msget(&msx,&msy,&msz);
if(msz==1&&msy>28&&msy<40&&msx>520&&msx<544)/* 點擊小差*/
{ /* 若是剛建的密碼文件,且沒有向其中寫入密碼,就刪除該文件*/
exit(1);
}
if(rand()%54321==1)
{ /* 時鐘*/
Nomouse();
j=j>6?6:j;
if(j<6)/*向左運動*/
{ puttext(48-j,11,58-j,11,buf1);
window(48-j+2,11,58-j-1,11);
j++;
}
if(j>=6)
{ /*向右運動*/
l++;puttext(48-j+l,11,58-j+l,11,buf1);
window(48-j+l+2,11,58-j+l-1,11);
}
gettime(&t);
textbackground(0);
textcolor(14);
cprintf(" %2d:%2d ",t.ti_hour,t.ti_min);
if(l>=6) l=j=0;
/* 信息框*/
if(rand()%10==1&&!Msinbox(120,96,328,144))
{
window(15,13,41,18);
My_setcolor(3,0);
if(helpi==0)
clrscr();
gotoxy(hlepx,helpy);
cputs("\n");
cputs(help[++helpi]);
if(helpi>=7)
helpi=1;
hlepx=wherex();
helpy=wherey();
}
Showmouse();
}
if(rand()%56789==1)
{ /* welcome動畫效果*/
Nomouse();
puttext(58-(++k), 1,80-k,1,buf0);
Showmouse();
}
if(k==80)
k=0;
}while(!kbhit());
slect=bioskey(0);/* 獲取字符*/
if(slect==ESC||slect==Alt_X)
{ /* 取消登錄*/
exit(1);
}
else
break;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -