資源描述:
《代碼_企業(yè)管理_經管營銷_專業(yè)資料》由會員上傳分享,免費在線閱讀,更多相關內容在工程資料-天天文庫。
1、代碼一.主界面代碼#include"main.h"mouse_msgm;voidwelcome(){PIMAGEimg0=newimage(941,525);getimage(img0,"image/begin.png",0,0);putimage(0,0,941,525,img0,0,0);delay_ms(1000);}intmenu(){cleardevice();PIMAGEimgmain=newimage(941,525);getimage(imgmain,"image/main.png",0,0);puti
2、mage(0,0,941,525,imgmain,0,0);intchoice=0;PIMAGEimg=newimage(941,525);getimage(img,"image/denglu.png",0,0);PIMAGEimg1=newimage(941,525);getimage(img1,"image/denglu1.png",0,0);PIMAGEimg2=newimage(941,525);getimage(img2,"image/denglu2.png",0,0);putimage(0,0,941,52
3、5,img,0,0);m=getmouse();while(true){m=getmouse();if(m.x>178&&m.x<392&&m.y>250&&m.y<388){//putimage(0,0,941,525,imgmain,0,0);putimage(0,0,941,525,img1,0,0);if(m.is_down()){choice=1;break;}}elseif(m.x>522&&m.x<743&&m.y>240&&m.y<380){//putimage(0,0,941,525,imgmain,
4、0,0);putimage(0,0,941,525,img2,0,0);if(m.is_down()){choice=2;break;}}else{//putimage(0,0,941,525,imgmain,0,0);putimage(0,0,941,525,img,0,0);}}cleardevice();returnchoice;}voidmainmenu(){intchoice=0;choice=menu();switch(choice){case1:usermain();break;case2:adminma
5、in();break;}}voidmain(){Windowsetmain();welcome();mainmenu();}一.管理員界面#include"admin.h"voidlogin(){admina;FILE*f1;strcpy(a.password,"TurboC");f1=fopen("d:/adminpassword.dat","ab");fclose(f1);f1=fopen("d:/adminpassword.dat","rb");fread(&a,sizeof(a),1,f1);fclose(f1
6、);PIMAGEimgmain=newimage(941,525);getimage(imgmain,"image/main.png",0,0);putimage(0,0,941,525,imgmain,0,0);chartemp[20];inputbox_getline("管理員登陸","請輸入您的ID(默認:admin)",temp,20);if(strcmp(temp,"admin")!=0)do{inputbox_getline("管理員登陸","錯誤!請輸入您的ID(默認:admin)",temp,20);}
7、while(strcmp(temp,"admin")!=0);inputbox_getline("管理員登陸","請輸入您的密碼(默認:TurboC)",temp,20);if(strcmp(temp,a.password)!=0)do{inputbox_getline("管理員登陸","錯誤!請輸入您的密碼(默認:TurboC)",temp,20);}while(strcmp(temp,a.password)!=0);outtextxy(200,200,"登陸成功!");delay_ms(1000);}voidadm
8、inmain(){login();adminf();}voidadminf(){cleardevice();PIMAGEimgmain=newimage(941,525);getimage(imgmain,"image/main.png",0,0);putimage(0,0,941,525,imgmain,0,0);PIMAGEi