///////////////////////////////////////////////////////////////////////////////////////////////////////////主执行函数;//////////////////////////////////////////////////////////////////////////////////////////////////////////////#includewindows.h#includeEnter.h#includeSoldTk.h#includefile.hstaticstructnode*head;staticHINSTANCEHInstance;staticintNCmdShow;intWINAPIWinMain(HINSTANCEhInstance,//handletocurrentinstanceHINSTANCEhPrevInstance,//handletopreviousinstanceLPSTRlpCmdLine,//commandlineintnCmdShow//showstate){head=NULL;head=readFile(head);if(!head){createFile();}HInstance=hInstance;NCmdShow=nCmdShow;//MyRegisterClassNe(hInstance);//InitNe(hInstance,nCmdShow);//InitSo(HInstance,NCmdShow);MyRegisterClassEn(HInstance);InitEnter(HInstance,NCmdShow);MSGmsg;while(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);}}///////////////////////////////////////////////////////////////////////////////////////////////////////////登录界面设置;//////////////////////////////////////////////////////////////////////////////////////////////////////////////#ifndef_ENTER//#define_ENTER//#includewindows.h//#includeiostream//#includestdio.h#includeMenu.h#includehead.hexternHINSTANCEHInstance;externintNCmdShow;externHWNDhwndEditEn1;externcharstrEnter1[20];externHWNDhwndEditEn2;externcharstrEnter2[20];usingnamespacestd;LRESULTCALLBACKWndProcEn(HWNDhwnd,//handletowindowUINTuMsg,//messageidentifierWPARAMwParam,//firstmessageparameterLPARAMlParam//secondmessageparameter);intMyRegisterClassEn(HINSTANCEhInstance)//////////登陆界面窗口注册;{WNDCLASSwndclass;wndclass.cbClsExtra=0;wndclass.cbWndExtra=0;wndclass.hbrBackground=(HBRUSH)(COLOR_WINDOW+1);wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);wndclass.hInstance=hInstance;wndclass.lpfnWndProc=WndProcEn;wndclass.lpszClassName=Enter;wndclass.lpszMenuName=NULL;wndclass.style=CS_HREDRAW|CS_VREDRAW;returnRegisterClass(&wndclass);}BOOLInitEnter(HINSTANCEhInstance,intnCmdShow)///////登陆界面窗口创建;{HWNDhwnd=CreateWindow(Enter,登录,WS_DLGFRAME,400,150,500,300,NULL,NULL,hInstance,NULL);if(!hwnd){returnFALSE;}ShowWindow(hwnd,nCmdShow);UpdateWindow(hwnd);hwndEditEn1=CreateWindow(edit,NULL,WS_CHILD|WS_VISIBLE|WS_BORDER,//编辑框设置;150,110,250,25,hwnd,NULL,NULL,NULL);hwndEditEn2=CreateWindow(edit,NULL,WS_CHILD|WS_VISIBLE|WS_BORDER,//编辑框设置;150,150,250,25,hwnd,NULL,NULL,NULL);CreateWindow(button,登录,WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,80,200,70,30,hwnd,(HMENU)IDC_ButtonEnter1,NULL,NULL);//登录按钮;CreateWindow(button,退出,WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,360,200,70,30,hwnd,(HMENU)IDC_ButtonEnter2,NULL,NULL);//退出按钮;/////////////////////////////////////////////////////////////////////////////////////////////////////hwnd2=Hwnd;returnTRUE;}LRESULTCALLBACKWndProcEn(HWNDhwnd,//handletowindowUINTuMsg,//messageidentifierWPARAMwParam,//firstmessageparameterLPARAMlParam//secondmessageparameter){WORDwmId;WORDwmEvent;PAINTSTRUCTps;HDChdc;switch(uMsg){caseWM_COMMAND:wmId=LOWORD(wParam);wmEvent=HIWORD(wParam);//Parsethemenuselections:switch(wmId){caseIDC_ButtonEnter2:if(IDYES==MessageBox(hwnd,你确定要退出么?,MessageBox,MB_YESNO)){DestroyWindow(hwnd);PostQuitMessage(0);}//SendMessage(hwnd,WM_CLOSE,NULL,NULL);//MessageBox(hwnd,Hello,World!,Message,MB_OK|MB_ICONINFORMATION);adminbreak;caseIDC_ButtonEnter1:GetWindowText(hwndEditEn1,strEnter1,20);GetWindowText(hwndEditEn2,strEnter2,20);if(inti=!strcmp(strEnter1,admin)&&!strcmp(strEnter2,123456)){DestroyWindow(hwnd);MyRegisterClassMe(HInstance);InitMe(HInstance,NCmdShow);}elseMessageBox(hwnd,输入错误!,Message,MB_OK);break;default:returnDefWindowProc(hwnd,uMsg,wParam,lParam);}break;caseWM_PAINT:hdc=BeginPaint(hwnd,&ps);TextOut(hdc,140,50,欢迎进入机票订购信息管理系统,strlen(欢迎进入机票订购信息管理系统));TextOut(hdc,90,115,用户名:,strlen(用户名:));//打印用户名;TextOut(hdc,94,155,密码:,strlen(密码:));//打印密码;EndPaint(hwnd,&ps);break;caseWM_DESTROY://PostQuitMessage(0);break;default:DefWindowProc(hwnd,uMsg,wParam,lParam);}returnDefWindowProc(hwnd,uMsg,wParam,lParam);}//////////////////////////////////////////////////////////////////////////////////////////////////////////文件保存函数;///定义了文件保存相关函数;/////////////////////////////////////////////////////////////////////////////////////////////////////////#pragmaonce#includestdio.h#includestdlib.h#includelist.h//要包含链表操作的头文件,因为从文件读出的每条信息都要//依会员顺序添加到单链表中,单链表的结点值最终保存在文件中voidcreateFile(){//Typedata;FILE*fp;if((fp=fopen(c:\\member.dat,wb))==NULL)//指定好文件名,以写入方式打开{//printf(cannotopenfilemember.dat!\n);//若打开失败,输出提示信息,退出exit(0);}//printf(inputmembers\'information,endedwithnum=0\n);//readNode(&data);//调用prepare.h中的readNode读数据//while(!endWith(data))//当读入的会员名不为0时循环继续//{//fwrite(&data,size,1,fp);//将刚才读入的一条记录写入文件//readNode(&data);//继续读去下一个元素的数据//}fclose(fp);//关闭文件}structnode*readFile(structnode*head)//将文件中的内容读出置于单链表中{Typedata;//ZeroMemory(&data,size);FILE*fp;head=NULL;if((fp=fopen(c:\\member.dat,rb))==NULL)//如果打开失败输出提示信息,返回0{//printf(filedoesnotexist,youshouldcreateafile:\n);return(0);}fread(&data,size-4,1,fp);//读出第一条记录while(!feof(fp))//文件未结束时循环{head=InsertAfter(head