松鼠的博客

导航

TVCLUnZip控件使用

#include <vcl.h>
#include 
"VCLUnZip.hpp"
#include 
"kpZipObj.hpp"

#pragma hdrstop

//---------------------------------------------------------------------------

#pragma argsused
#pragma link "VCLUnZip"
int main(int argc, char* argv[])
{

TVCLUnZip
* Zipper = new TVCLUnZip(Application);

Zipper
->ZipName = "c:\test\Zipfile.zip"// set the zip filename
Zipper->ReadZip(); // open it and read its information

// List filenames in zip file

// determine which files to unzip

Zipper
->FilesList->Add("*.*"); // unzip all .cpp files

Zipper
->DoAll = True; // Don't unzip all files

Zipper
->DestDir = "c:\mydir"// Set destination directory
Zipper->RecreateDirs = true// don't recreate directory structures
Zipper->RetainAttributes = True; // Set attributes to original after unzipping

int NumUnzipped = Zipper->UnZip(); // Extract files, return value is the number of files actually unzipped

delete Zipper;
return 0;

posted on 2008-08-20 16:17  Xproer-松鼠  阅读(753)  评论(0)    收藏  举报