Здравствуйте!
Сделать .zip архив файла и обратно получилось. Подскажите! как сделать архив ПАПКИ?
//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
#include "Uzip.h"
#include <System.Zip.hpp>
#include <System.IOUtils.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender)
{
TZipFile *ZipCompress = new TZipFile();
ZipCompress->Open(GetCurrentDir()+"/sdcard/"+"ZipTest/"+"ZipTest.zip",zmWrite);
ZipCompress->Add(System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPath(),"test1.txt") ,"test1.txt",zcDeflate);
ZipCompress->Add(System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPath(),"test2.txt") ,"test2.txt",zcDeflate);
ZipCompress->Close();
ZipCompress->Free();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button2Click(TObject *Sender)
{
TZipFile *ZipDecompress = new TZipFile();
ZipDecompress->Open(GetCurrentDir()+"/sdcard/"+"ZipTest/"+"ZipTest.zip",zmRead);
ZipDecompress->ExtractAll(GetCurrentDir()+"/sdcard/"+"ZipTest");
ZipDecompress->Free();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::FormClose(TObject *Sender, TCloseAction &Action)
{
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::FormCreate(TObject *Sender)
{
CreateDir(GetCurrentDir()+"/sdcard/"+"ZipTest");
}
//---------------------------------------------------------------------------