⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.c

📁 操作系统的进程管理、设备管理、文件管理的动态演示(C版)
💻 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 + -