²Ù×÷ϵͳ¿Î³ÌÉè¼Æ

char ch; switch(mod){ //¸æËßÓû§¶Ô¸ÃÎļþȨÏÞÐ޸ĵĽá¹û£¬ÒÔ±ãÓû§È·ÈÏ case 30: cout<<\µ±Ç°È¨ÏÞÉèÖãºÆäËûÓû§¶Ô\¼Èû¶ÁȨҲûдȨ£¡\ break; case 31: cout<<\µ±Ç°È¨ÏÞÉèÖãºÆäËûÓû§¶Ô\û¶ÁȨµ«ÓÐдȨ£¡\ break; case 32: cout<<\µ±Ç°È¨ÏÞÉèÖãºÆäËûÓû§¶Ô\ÓжÁȨµ«Ã»Ð´È¨£¡\ break; case 33: cout<<\µ±Ç°È¨ÏÞÉèÖãºÆäËûÓû§¶Ô\¼ÈÓжÁȨҲÓÐдȨ£¡\ break; default: break; } cout<<\È·ÈÏ°´'Y'£¬È¡Ïû°´'N':\ cin>>ch; //ÊäÈëÑ¡Ôñ switch(ch){ case 'Y': case 'y':flag1=false;break; default: flag1=true; } } } //¸üÐÂÎļþÐÅÏ¢¹ÜÀíÄ£¿é£¬Ïà¹Ø²Ù×÷ÀàËÆÉÏÃ棬²»ÔÚ׸Êö if((infile=fopen(in,\ //´ò¿ªÎļþÅжÏÊÇ·ñΪ¿Õ { cout<<\²Ù×÷³öÏÖ´íÎ󣬶ԴËÎÒÃDZíʾǸÒ⣡\ return; } else{ if((outfile=fopen(out,\ //´ò¿ªÎļþÅжÏÊÇ·ñΪ¿Õ { cout<<\²Ù×÷³öÏÖ´íÎ󣬶ԴËÎÒÃDZíʾǸÒ⣡\ fclose(infile);//fclose(outfile); return; } else{ while(1) { fread(ufd,sizeof(UFD),1,infile); //¶ÁÈ¡Îļþ if(feof(infile)) //ÎļþÊÇ·ñ´ò¿ª break;

if((strcmp(ufd->filename,buffer))==0) //ÕÒµ½Îļþ ufd->safecode=mod; //ÐÞ¸ÄȨÏÞÖµ fwrite(ufd,sizeof(UFD),1,outfile); //дÎļþ } fclose(infile);fclose(outfile); remove(in); //ÒƳý rename(out,in); //ÖØÃüÃû } } }

//------------------------------------------------------------------------------------------------ void Execute(int i,int len,int cmdset)//Ö´ÐÐÃüÁÊý { int SELETE; int j=0; for(;i'||cmd[i]==' '){ // buffer[i] = '\\0'; break; } /* if(i==len-1) { buffer[j]=cmd[i]; buffer[j+1]='\\0'; break; }*/ buffer[j]=cmd[i];j++; //Êý×é³ÉÔ±ÏÂÒ»¸ö } buffer[j]='\\0'; strcat(buffer,\ //Ìí¼ÓÀ©Õ¹Ãû.txt switch(cmdset) { case 1: //Í˳ö ByeFile(true); SELETE = LoginDisplay(); //·µ»ØµÇ½ҳÃæ if(SELETE==0) //Èç¹ûÑ¡ÏîÊÇ0 exit(0); //Í˳ö Login(SELETE); //Óû§µÇ½£¬»òÕß×¢²áº¯Êý break; case 2: //¸Ä±äÎļþ²Ù×÷ȨÏÞ if((strcmp(buffer,\ //±È½ÏÎļþ {

cout<<\ÊäÈëÃüÁî³ö´í£¡\ return; } ChangeMod(); //µ÷ÓÃÐÞ¸ÄijÎļþµÄÖ´ÐÐȨÏÞº¯Êý break; case 3: //ɾ³ýÓû§ DeleteUser(); SELETE = LoginDisplay(); //·µ»ØµÇ½ҳÃæ if(SELETE==0) //Èç¹ûÑ¡ÏîÊÇ0 exit(0); //Í˳ö Login(SELETE); //Óû§µÇ½£¬»òÕß×¢²áº¯Êý//µ÷ÓÃɾ³ýÓû§º¯Êý break; case 4: //´´½¨Îļþ if((strcmp(buffer,\ //±È½ÏÎļþ { cout<<\ÊäÈëÃüÁî³ö´í£¡\ return; } CreatFile(); //µ÷Óô´½¨º¯Êý break; case 5: //ɾ³ýÎļþ if((strcmp(buffer,\ //±È½ÏÎļþ { cout<<\ÊäÈëÃüÁî³ö´í£¡\ return; } DeleteFile(); //µ÷ÓÃɾ³ýÎļþº¯Êý break; case 6: //Áгö¸ÃÓû§ËùÓÐÎļþÇåµ¥ ListAllFile(); break; case 7: //´ò¿ªÎļþ if((strcmp(buffer,\ //±È½ÏÎļþ { cout<<\ÊäÈëÃüÁî³ö´í£¡\ return; } OpenFile(); //µ÷Óôò¿ªÎļþº¯Êý break; case 8: //¶ÁÎļþ if((strcmp(buffer,\ //±È½ÏÎļþ { cout<<\ÊäÈëÃüÁî³ö´í£¡\ return;

} ReadFile(); //µ÷ÓöÁÎļþº¯Êý break; case 9: //дÎļþ if((strcmp(buffer,\ //±È½ÏÎļþ { cout<<\ÊäÈëÃüÁî³ö´í£¡\ return; } WriteFile(); //µ÷ÓÃдÎļþº¯Êý break; default: break; } }

//------------------------------------------------------------------------------------------------ void Command()//¶ÁÈ¡Óû§ÊäÈëµÄÃüÁ²¢½«Æäת»»³ÉϵͳÄÜʶ±ðµÄÃüÁî { int len = 0,i,j; int cmdset; cout<<\ cout<<\ Óû§×¢ÏúÃüÁî chmod ¸Ä±äij¸öÎļþµÄÖ´ÐÐȨÏÞÃüÁî\ cout<<\ ɾ³ýÓû§×¢²áÐÅÏ¢ÃüÁî create ÔÚµ±Ç°Ä¿Â¼Ï´´½¨Ò»ÎļþÃüÁî\ cout<<\ɾ³ýµ±Ç°Óû§Ä¿Â¼ÏµÄÒ»¸öÎļþÃüÁî list ÏÔʾע²áĿ¼ÏµÄËùÓÐÎļþÐÅÏ¢ÃüÁî\ cout<<\ ÔÚwindow½çÃæÏ´ò¿ªÄ³¸öÎļþÃüÁî read ¶ÁÎļþÐÅÏ¢ÃüÁî \

cout<<\ Ïòij¸öÎļþдÈëеÄÐÅÏ¢ÃüÁî\ cout<<\ while(1) { cmdset = 0; cout<<\ cin>>cmd; len = strlen(cmd); //¼ÆË㳤¶È i=0;j=0; while(cmd[i]=='>'||cmd[i]==' '){i++;} //¹ýÂË¿Õ¸ñ¼üºÍ'>' for(;i' || cmd[i]==' ' || i==len-1) //¶¨Î»ÃüÁî×îºóÒ»¸ö×Ö·û { if(cmd[i]=='>' || cmd[i]==' ') buffer[j] = '\\0'; else

if(i==len-1) { buffer[j]=cmd[i]; buffer[j+1]='\\0'; } i++; j=0; int low=1,mid,high=keynum-1; bool BOOL = false; //ÖÃÆìfalse while(low<=high){ //ÕÒµ½¸ÃÃüÁî¹Ø¼ü×ÖµÄÄÚ²¿Ê¶±ðÂë mid=(low+high)/2; if (strcmp(buffer,KWORD[mid])<=0) high=mid-1; if (strcmp(buffer,KWORD[mid])>=0) low=mid+1; if(strcmp(buffer,KWORD[mid])==0){ BOOL = true; break; } } if(!BOOL) //ÅжÏÊÇ·ñÊÇÕýÈ·ÃüÁî { cout<<\²»ÊÇϵͳ¶¨ÒåµÄÃüÁî...\ cmdset = 0; break; } else {cmdset = mid;break;} } else{ buffer[j] = cmd[i]; j++; } } if(cmdset == 0) continue; while(cmd[i]=='>'||cmd[i]==' '){i++;} //¹ýÂË¿Õ¸ñ¼üºÍ'>' buffer[0]='\\0'; Execute(i,len,cmdset); //Ö´ÐиÃÃüÁî } }

//------------------------------------------------------------------------------------------------ void main() { while(1){ int SELETE = LoginDisplay(); //µ÷ÓõǽѡÏî²Ù×÷º¯Êý if(SELETE==0) //Èç¹ûÑ¡Ôñ0 exit(0); //Í˳öϵͳ bool BOOL = Login(SELETE); //Óû§µÇ½£¬»òÕß×¢²áº¯Êý

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ì滻Ϊ@) ËÕICP±¸20003344ºÅ-4