- 注册时间
- 2005-9-12
- 最后登录
- 1970-1-1
|
- char filename[60];
- char filenameb[60];
- char filenamec[60];
- char fname[21];
- char cch[21];
- char zf[222];
- char dira[60];
- char dirb[60];
- char dird[60];
- char dirc[60];
- char zj[60];
- char qj[222];
- void sz(){
- char ch,fp;
- char ah[11],dh[11],fh[11];
- int i,o;
- if((fp=fopen("/LavaData/xintu.dat","r"))==0){
- if((fp=fopen("/LavaData/xintu.dat","w"))==0)
- {printf("打开%s失败!\n",dira);
- getchar();exit(0);
- }
- while(1){
- ClearScreen();
- TextOut(1,1,"设置密码:",1);
- TextOut(1,13,ah,1);
- Refresh();
- ch=getchar();
- if(ch>='a'&&ch<='z'){ah[i]=ch;i++;}
- if(i>=10)break;
- if(ch==13)[font=新宋体]break;
- if(ch==LEFT_KEY)[/font]ah[--i]=0;
- }
- fwrite(ah,1,i-1,fp);
- fclose(fp);
- }
- else fclose(fp);
-
-
- if((fp=fopen("/LavaData/xintu.dat","r"))==0)
- {printf("打开%s失败!\n",dira);getchar();exit(0);}
- fread(dh,1,5,fp);
- fclose(fp);
- while(1){
- SetScreen(0);printf("请输入密码:");
- printf("\n%s_",fh);
- ch=getchar();
- if(ch>='a'&&ch<='z'){fh[o]=ch;o++;}
- if(o>=10)break;
- if(ch==13)break;
- if(ch==LEFT_KEY)fh[--o]=0;
- }
- if(!strcmp(dh,fh))printf("ok");
- else {SetScreen(1);printf("密码错误!");getchar();
- exit(0);}
- fclose(fp);
-
- }
- void kstp()
- {
- int x,y,i;x=1;y=1;
-
- for(i=0;i<=40;i++)
- {
- ClearScreen();
- Rectangle(1,0,159,79,1);
- Rectangle(1,0,158,78,1);
- TextOut(x+i,y+i,"软",1);
- TextOut(x+147-i,y+i,"件",1);
- TextOut(x+i,y+67-i,"信",1);
- TextOut(x+147-i,y+67-i,"徒",1);
- Refresh();Delay(20);
- }
- TextOut(35,11,"学",1);Delay(222);Refresh();
- TextOut(55,11,"会",1);Delay(222);Refresh();
- TextOut(75,11,"一",1);Delay(222);Refresh();
- TextOut(95,11,"个",1);Delay(222);Refresh();
- TextOut(115,11,"字",1);Delay(222);Refresh();
- for(i=0;i<5;i++)
- {
- Block(1,1,160,80,2);Refresh();
- }
- }
- void byby()
- {
- int x,y,i;x=1;y=1;
- for(i=0;i<=40;i++)
- {
- ClearScreen();
- Rectangle(1,0,159,79,1);
- Rectangle(1,0,158,78,1);
- TextOut(x+i,y+i,"使",1);
- TextOut(x+147-i,y+i,"用",1);
- TextOut(x+i,y+67-i,"感",1);
- TextOut(x+147-i,y+67-i,"谢",1);
- Refresh();Delay(10);
- }
- }
- void wbhb()
- {
- long x,y;
- int d,len;
- char ch,fp,fpb;
- if((fp=fopen(dira,"r+"))==0)
- {printf("打开%s失败!\n",dira);getchar();exit(0);}
- if((fpb=fopen(dirb,"r"))==0)
- {printf("打开%s失败!\n",dirb);getchar();exit(0);}
- fseek(fp,0,2);
- SetScreen(1);
- printf("正在合并中....\n");
- while(1)
- {
- d=fread(zf,1,221,fpb);
- if(feof(fpb)){
- fwrite(zf,1,d,fp);
- break;
- }
- fwrite(zf,1,d,fp);
- memmove(zf,qj,221);
- }
- printf("合并成功!\n");
- x=ftell(fp);y=ftell(fpb);
- fclose(fp);fclose(fpb);
- printf("合成后的大小为:\n");
- printf("%s:是%dKB\n",filename,x/1024);
- printf("%s:是%dKB\n",filenameb,y/1024);
- memmove(dira,zj,60);
- memmove(dirb,zj,60);
- getchar();
- }
- int fzwj()
- {
- int d,len,ah;
- long z,a,b;
- char tmp;
- char ch,fp,fpb;
- memmove(dirb,zj,60);
-
- strcat(dirb,dirc);
- strcat(dirb,fname);fclose(fp);
-
- if((fp=fopen(dira,"r"))==0)
- {printf("打开%s失败!\n",dira);getchar();exit(0);}
- if((fpb=fopen(dirb,"r"))==0)
- {zh:fclose(fpb);
- if((fpb=fopen(dirb,"w"))==0)
- {printf("打开%s失败!\n",dirb);getchar();exit(0);}
- ClearScreen();
- TextOut(1,1,"正在复制中....",1);
- fseek(fp,0,2);
- z=ftell(fp);
- b=z/100;
- fseek(fp,0,0);
- while(1)
- {
- d=fread(zf,1,222,fp);
- a=ftell(fp);ah=a/b;
- if(feof(fp)){fwrite(zf,1,d,fpb);break;}
- fwrite(zf,1,d,fpb);
- Rectangle(1,13,101,18,1);Delay(11);
- Block(1,13,ah+4,18,1);
-
- memmove(zf,qj,222);
- Refresh();
- }
- }
- else {SetScreen(0);printf("文件已存在!是否覆盖?");
- printf("Y:覆盖!");printf("N:取消!");
- ch=getchar();
- if(ch=='y')goto zh;
- else {fclose(fp);fclose(fpb);return 0;}
- }
- TextOut(110,7,"复制成功!",1);
- TextOut(1,20,"是否删除原文件?",1);
- TextOut(1,33,"Y:删除!",1);TextOut(1,46,"N:取消!",1);
- TextOut(1,65,dirb,1);
- fclose(fp);fclose(fpb);
- Refresh();
- ch=getchar();
- if(ch==121){if(DeleteFile(dira))TextOut(1,59,"删除成功!",1);}
- else TextOut(1,59,"删除失败!",1);
- Refresh();
-
- memmove(dira,zj,60);
- memmove(dirc,zj,60);
- getchar();
- }
- void wjjm()
- {
- int d,len;
- char tmp;
- char ch,fp,fpb;
- if((fp=fopen(dira,"r"))==0)
- {printf("打开%s失败!\n",dira);getchar();exit(0);}
- if((fpb=fopen("/LavaData/sz.dat","w"))==0)
- {printf("打开%s失败!\n",dirb);getchar();exit(0);}
- SetScreen(1);
- printf("正在加密中....\n");
- while(1)
- {
- d=fread(zf,1,222,fp);
- Secret(zf,d,"xintu");
- if(feof(fp)){
- Secret(zf,d,"xintu");
- fwrite(zf,1,d,fpb);
- break;
- }
-
- fwrite(zf,1,d,fpb);
- memmove(zf,qj,222);
- }
- fclose(fp);fclose(fpb);
- if((fp=fopen("/LavaData/sz.dat","r"))==0)
- {printf("打开%s失败!\n",dira);getchar();exit(0);}
- if((fpb=fopen(dira,"w"))==0)
- {printf("打开%s失败!\n",dirb);getchar();exit(0);}
- while(1)
- {
- d=fread(zf,1,222,fp);
- if(feof(fp)){fwrite(zf,1,d,fpb);break;}
- fwrite(zf,1,d,fpb);
- }
- fclose(fp);fclose(fpb);
- memmove(dira,zj,60);
- memmove(dirc,zj,60);
- printf("加密成功!\n");
- getchar();
- }
- void cjml()
- {
- }
- char dkzdwj()
- {
- int i,n,tmp;
- tmp=n=0;i=1;
- ChDir("/");strcat(dira,"/");
- for(;;){
- if(!FileList(filename)||!strcmp(filename,".."))
- { tmp--;i=i-n-1;
- memmove(dira+i,dird,n);
- if(tmp<0){memmove(dira,zj,60);
- break;}
- ChDir("..");continue;
- }
- if(ChDir(filename)){
- n=strlen(filename);
- strcat(dira,filename);i=i+n;
- strcat(dira,"/");i++;
- tmp++;continue;
- }
- else tmp--;strcat(dira,filename);
- n=strlen(filename);i=i+n;
- break;
- }
- }
- char dkzdwjb()
- {
- int i,n,tmp;
- tmp=n=0;i=1;
- ChDir("/");strcat(dirb,"/");
- for(;;){
- if(!FileList(filenameb)||!strcmp(filenameb,".."))
- { tmp--;i=i-n-1;
- memmove(dirb+i,dird,n);
- if(tmp<0){memmove(dirb,zj,60);break;}
- ChDir("..");continue;
- }
- if(ChDir(filenameb)){
- n=strlen(filenameb);
- strcat(dirb,filenameb);i=i+n;
- strcat(dirb,"/");i++;
- tmp++;continue;
- }
- else tmp--;strcat(dirb,filenameb);
- n=strlen(filenameb);i=i+n;
- break;
- }
- }
- char dkzdwjc()
- {
- ChDir("/");strcat(dirc,"/");
- for (;;) {
- if(!FileList(filenameb))
- {
- memmove(dirc,zj,60); return 0;
- }
- if(!strcmp(filename,"..")){memmove(dirc,zj,60);;return 0;}
- if(ChDir(filenameb))
- {
- strcat(dirc,filenameb);
- strcat(dirc,"/"); strcat(dirc,filename);
- return 1;
- }
- else return 0;
- }
- }
- void rjdx()
- {
- long rjdxb;
- char fp;
- SetScreen(1);
- if((fp=fopen(filename,"r"))==0)
- {printf("打开失败!\n");}
- else{
- rjdxb=fseek(fp,0,2);
-
- printf(dira);
- printf("\n大小为:");
- printf("%dByte",rjdxb);
- printf("\n占用空间为:");
- printf("%dKB",rjdxb/1024);
-
- }
- fclose(fp);
- getchar();
- memmove(dira,zj,60);
- }
- void wjsc()
- {
- char ch;
- SetScreen(1);
- printf("%s\n",dira);
- printf("确定删除吗?\nY:确定\nN:取消\n");
- ch=getchar();
- if(ch==121){if(DeleteFile(filename))printf("删除成功!\n");
- else printf("删除失败!");}
- else printf("已放弃!\n");
- getchar();
- memmove(dira,zj,60);
- }
- void ld()
- {
-
- }
- void rl()
- {
- }
- void mmxg(){
- char fp,ch,zh,i;
- char fh[11];
- memset(fh,0,11);
- SetScreen(0);
- printf("修改密码!\nY:确认!\N:取消!");
- ch=getchar();
- if(ch=='y'){
- while(1){
- SetScreen(0);printf("请重新输入密码!\n");
- printf("\n%s_",fh);
- zh=getchar();
- if(zh>='a'&&zh<='z'){
- fh[i]=zh;i++;
- if(i>=10)break;
- }
- if(zh==13)break;
- if(zh==LEFT_KEY)fh[--i]=0;
- }
- }
- if((fp=fopen("/xintu.dat","w"))==0)exit(0);
- else {
-
- fwrite(fh,1,i,fp);
- fclose(fp);
- }
- printf("ok!");getchar();
-
- }
- void main()
- {
- int o,i,x,y,k;
- char fp,ch;
- i=1;x=1;y=1;ch=1;
- kstp();//开始图片
- sz();
- zh:while(ch)
- {
- ClearScreen();
- TextOut(1,1," 系 统 软 件 LAVAX 第一版",1);
- TextOut(1,14,"文本合并 (H)",1);TextOut(81,14,"文件加密 (j)",1);
- TextOut(1,27,"软件大小 (Y)",1);TextOut(81,27,"创建目录 (C)",1);
- TextOut(1,40,"文件删除 (D)",1);TextOut(81,40,"TC800亮度(L)",1);
- TextOut(1,53,"文件复制 (S)",1);TextOut(81,53,"TC800容量(R)",1);
- TextOut(1,68,"信 徒 软 件 chinese xintu",1);
- Block(1,1,159,13,2);Block(1,68,159,79,2);
- Block(x,y+13,x+79,y+25,2);
- Rectangle(1,0,159,79,1);
- Refresh();
-
- ch=getchar();
- if(ch==27){byby();ch=0;}
- if(ch==21){y=y+13;if(y>40)y=1;}
- if(ch==20){y=y-13;if(y<1)y=40;}
- if(ch==22){x=x-80;if(x<1)x=81;}
- if(ch==23){x=x+80;if(x>81)x=1;}
- if(ch==25||ch==13||ch=='h'||ch=='s'||ch=='y'||ch=='d'||ch=='j'||ch=='c'||ch=='l'||ch=='r')
- {
- if(ch=='h'){x=1;y=1;}
- if(ch=='y'){x=1;y=14;}
- if(ch=='d'){x=1;y=27;}
- if(ch=='s'){x=1;y=40;}
- if(ch=='j'){x=81;y=1;}
- if(ch=='c'){x=81;y=14;}
- if(ch=='l'){x=81;y=27;}
- if(ch=='r'){x=81;y=40;}
- if(ch==25)mmxg();
- if((x==1&&y==1)&&(ch==13||ch=='h')){x=1;y=1;
- SetScreen(1);printf("打开要保存的文本\n");getchar();dkzdwj();
- if(ChDir(filename))goto zh;
- SetScreen(1);printf("打开要加入的文本\n");getchar();dkzdwjb();
- if(ChDir(filenameb))goto zh;
- wbhb(); }//文本合并
- if((x==1&&y==14)&&(ch==13||ch=='y')){x=1;y=14;dkzdwj(); if(ChDir(filename))goto zh;rjdx();}//软件大小
- if((x==1&&y==27)&&(ch==13||ch=='d')){x=1;y=27;dkzdwj(); if(ChDir(filename))goto zh;wjsc();}//文件删除
- if((x==1&&y==40)&&(ch==13||ch=='s')){x=1;y=40;
- SetScreen(1);printf("打开要复制的文件\n");getchar();dkzdwj();
- if(ChDir(filename)){strcat(fname,filename);goto zh;}
- SetScreen(1);printf("打开要保存的路径\n");getchar();dkzdwjc();
- if(ChDir(filenameb))goto zh;
- fzwj();
- }//复制文件
- if((x==81&&y==1)&&(ch==13||ch=='j')){
- x=81;y=1;dkzdwj(); if(ChDir(filename))goto zh;
- wjjm();}//文件加密与解密
- if((x==81&&y==14)&&(ch==13||ch=='c')){x=81;y=14; cjml(); }//创建目录
-
- if((x==81&&y==27)&&(ch==13||ch=='l')){x=81;y=27;ld();}//亮度
- if((x==81&&y==40)&&(ch==13||ch=='r')){x=81;y=40;rl();}//容量
- }
- }
- }
复制代码 |
|