调用了7z.exe。首先先搜索硬盘内的压缩文件,没有搜索到直接进行下载(有待添加)。其次,进行文件的压缩和解压...部分功能有待完善,代码没有任何技术含量,无非是保持对技术的热爱。
#include
#include
#include
#include
#include
const int len = 1024;
void showtime();
void search();
void compress();
void decompress();
void help();
int main()
{
int n = 0;
while(n!=5)
{
showtime();
printf( ================================================= \n);
printf( +++++++++++++++++++++++++++++++++++++++++++++++++ \n);
printf( 1++++++++++++++++++++search+++++++++++++++++++++1 \n);
printf( 2+++++++++++++++++++compress++++++++++++++++++++2 \n);
printf( 3+++++++++++++++++++decompress++++++++++++++++++3 \n);
printf( 4+++++++++++++++++++++help++++++++++++++++++++++4 \n);
printf( 5+++++++++++++++++++++exit++++++++++++++++++++++5 \n);
printf( +++++++++++++++++++++++++++++++++++++++++++++++++ \n);
printf( ================================================= \n);
printf(请选择操作类型:\n);
scanf(%d,&n);
switch(n)
{
case 1 : search();break;
case 2 : compress();break;
case 3 : decompress();break;
case 4 : help();break;
case 5 : return 0;break;
default : printf(输入错误\n);
}
}
return 0;
}
void showtime()
{
time_t now;
now = time(null);
printf( %s, ctime(&now));
sleep(1000);
//system(cls);
}
void directorylist(lpcstr path)
{
win32_find_data finddata;
handle herror;
int filecount = 0;
char filepathname[len];
char fullpathname[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(\n%d %s , filecount, fullpathname); 本文链接http://www.cxybl.com/html/wlbc/php/20130626/38826.html