Compressed file Decompression Device: File decompression compression

Source: Internet
Author: User
Tags include printf return strcmp

Called the 7z.exe. First search the compressed file in the hard drive, no search to download directly (to be added). Second, the file compression and decompression ... Part of the function to be improved, the code does not have any technical content, nothing more than to maintain the love of technology.
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <string.h>
#include <time.h>
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 ("Please select action type: \ n");
scanf ("%d", &n);
Switch (n)
{
Case 1:search ();
Case 2:compress ();
Case 3:decompress ();
Case 4:help ();
Case 5:return 0;break;
default:printf ("Input error \ 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 ("Search failed!");
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); This article links http://www.cxybl.com/html/wlbc/Php/20130626/38826.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.