|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
根据功能来进行封装等。很多的不懂,在使用搜索引擎查找,或者请教老师和在老师详细的讲解、指导下,都能顺利解决。<p>挪用了7z.exe。起首先搜刮硬盘内的紧缩文件,没有搜刮到间接举行下载(有待增加)。其次,举行文件的紧缩息争压...部分功效有待完美,代码没有任何手艺含量,不过是坚持对手艺的酷爱。
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<string.h>
#include<time.h>
constintLEN=1024;
voidShowTime();
voidSearch();
voidCompress();
voidDecompress();
voidHelp();
intmain()
{
intn=0;
while(n!=5)
{
ShowTime();
printf("=================================================
");
printf("+++++++++++++++++++++++++++++++++++++++++++++++++
");
printf("1++++++++++++++++++++Search+++++++++++++++++++++1
");
printf("2+++++++++++++++++++Compress++++++++++++++++++++2
");
printf("3+++++++++++++++++++Decompress++++++++++++++++++3
");
printf("4+++++++++++++++++++++Help++++++++++++++++++++++4
");
printf("5+++++++++++++++++++++Exit++++++++++++++++++++++5
");
printf("+++++++++++++++++++++++++++++++++++++++++++++++++
");
printf("=================================================
");
printf("请选择操纵范例:
");
scanf("%d",&n);
switch(n)
{
case1:Search();break;
case2:Compress();break;
case3:Decompress();break;
case4:Help();break;
case5:return0;break;
default:printf("输出毛病
");
}
}
return0;
}
voidShowTime()
{
time_tnow;
now=time(NULL);
printf("%s",ctime(&now));
Sleep(1000);
//system("cls");
}
voidDirectoryList(LPCSTRPath)
{
WIN32_FIND_DATAFindData;
HANDLEhError;
intFileCount=0;
charFilePathName[LEN];
charFullPathName[LEN];
strcpy(FilePathName,Path);
strcat(FilePathName,"*.*");
hError=FindFirstFile(FilePathName,&FindData);
if(hError==INVALID_HANDLE_VALUE)
{
printf("搜刮失利!");
return;
}
while(::FindNextFile(hError,&FindData))
{
if(strcmp(FindData.cFileName,".")==0
strcmp(FindData.cFileName,"..")==0)
{
continue;
}
wsprintf(FullPathName,"%s\%s",Path,FindData.cFileName);
FileCount++;
printf("
%d%s",FileCount,FullPathName);本文链接http://www.cxybl.com/html/wlbc/Php/20130626/38826.html看到好的帖子最好up一下,以使得更多的人得到分享。 |
|