Heim > php教程 > php手册 > Hauptteil

压缩文件解压器: 文件解压压缩

WBOY
Freigeben: 2016-06-21 08:49:30
Original
1248 Leute haben es durchsucht

调用了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



Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Empfehlungen
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!