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

📄 passwin.c

📁 图书借阅管理程序v1.2
💻 C
字号:
#include<string.h>
#include<conio.h>
#include<stdio.h>
#include<alloc.h>

int ChangePassWin(struct dnode* head);/*用于修改密码*/
int ChangeDays(struct dnode* head);   /*用于修改最长的借书时间*/
/*********改变借书数量**********/
int    ChangeBorrowCount(struct dnode* bookhead,struct personnode* personhead);

int ChangeBorrowCount(struct dnode* bookhead,struct personnode* personhead)
{

 struct text_info ti;
 char block[4*34*5];
 char successmess[80];
 int  borrowcount;

 light_mouse(OFF);
 gettextinfo(&ti);
 gettext(25,8,59,13,block);
 window(26,9,59,13);
 textbackground(BLACK);
 clrscr();
 window(25,8,58,12);
 textbackground(LIGHTGRAY);
 textcolor(WHITE);
 clrscr();
 gotoxy(8,1);
 cprintf("修改基本借书数量\r\n");
 cprintf("  现在的基本借书数量是%.0f本。\r\n",bookhead->book.bookprice);
 cprintf("  修改后的基本借书数量是      本。");

 window(49,10,53,10);
 textbackground(BLACK);
 clrscr();
 light_mouse(ON);

 borrowcount=InputBookNum();
 if(borrowcount==CANCEL) goto back6;
 bookhead->book.bookprice=(float)borrowcount;
 SaveList(bookhead,"data\\list.lvj");

 sprintf(successmess,"基本借书数量已改为%d本。",borrowcount);
 MessageBox(30,10,successmess);

back6: myputtext(25,8,59,13,block);
       window(ti.winleft,ti.wintop,ti.winright,ti.winbottom);
       textattr(ti.attribute);
       gotoxy(ti.curx,ti.cury);
       return 1;
}




int ChangePassWin(struct dnode* head)
{
 struct text_info ti;
 char block[4*28*10];
 char* password;
 char* newpass;

 light_mouse(OFF);
 gettextinfo(&ti);
 gettext(24,7,53,17,block);

 window(25,8,53,17);
 textbackground(BLACK);
 clrscr();
 window(24,7,52,16);
 textbackground(2);
 textcolor(WHITE);
 clrscr();
 gotoxy(12,1);
 cprintf("修改密码");
 gotoxy(2,3);
 cprintf("请输入旧密码:");
 gotoxy(2,5);
 cprintf("请输入新密码:");
 gotoxy(2,7);
 cprintf("请再输入一遍:");


 textbackground(BLACK);
 textcolor(YELLOW);

 window(25,12,51,12);
 clrscr();
 window(25,14,51,14);
 clrscr();

 window(25,10,51,10);
 clrscr();
 light_mouse(ON);
 password=InputPassword();
 if(password==NULL) goto back3;

 if(!strcamp(password,head->book.bookname))
     {clrscr();
      cprintf("旧密码输入错误!");
      getch();
      goto back3;
     }
 window(25,12,51,12);
 newpass=InputPassword();
 if(newpass==NULL) goto back3;
 window(25,14,51,14);
 password=InputPassword();
 if(password==NULL) goto back3;

 if(!strcamp(newpass,password))
        {clrscr();
         cprintf("确认密码错误!");
         getch();
         goto back3;
        }
 else{strcpy(head->book.bookname,newpass); /*写入链表*/
      SaveList(head,"data\\list.lvj");
      clrscr();
      cprintf("密码已经成功修改!");
      getch();
     }
back3:
      myputtext(24,7,53,17,block);
      window(ti.winleft,ti.wintop,ti.winright,ti.winbottom);
      textattr(ti.attribute);
      gotoxy(ti.curx,ti.cury);

}



int ChangeDays(struct dnode* head)
{
 struct text_info ti;
 char block[4*34*5];
 char successmess[80];
 int  borrowdays;

 light_mouse(OFF);
 gettextinfo(&ti);
 gettext(25,8,59,13,block);
 window(26,9,59,13);
 textbackground(BLACK);
 clrscr();
 window(25,8,58,12);
 textbackground(LIGHTGRAY);
 textcolor(WHITE);
 clrscr();
 gotoxy(8,1);
 cprintf("修改基本借书时间\r\n");
 cprintf("  现在的基本借书时间是%d天。\r\n",head->book.booknum);
 cprintf("  修改后的基本借书时间是      天。");

 window(49,10,53,10);
 textbackground(BLACK);
 clrscr();
 light_mouse(ON);

 borrowdays=InputBookNum();
 if(borrowdays==CANCEL) goto back5;
 head->book.booknum=borrowdays;
 SaveList(head,"data\\list.lvj");

 sprintf(successmess,"基本借书时间已改为%d天。",borrowdays);
 MessageBox(30,10,successmess);

back5: myputtext(25,8,59,13,block);
       window(ti.winleft,ti.wintop,ti.winright,ti.winbottom);
       textattr(ti.attribute);
       gotoxy(ti.curx,ti.cury);
       return 1;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -