Home > Back-end >  7 z SDK compress and decompress the ZIP file
7 z SDK compress and decompress the ZIP file

Time:09-17

Someone with unit sevenzip; To unzip the files?

Procedure TFormMain. BtnCompressClick (Sender: TObject);
Var
The Arch: I7zOutArchive;
Counter: Integer;
The begin
If OpenDialog. Files. Count=0 then
The begin
ShowMessage (' add files');
Exit;
The end;
MemoOutput. Lines. Append (' to compress);
The Arch:=CreateOutArchive (CLSID_CFormat7z);//here with 7 z format, there is no problem, but with CLSID_CFormatZIP format, only
Able to operate a file, if add multiple files at the same time, in the call Arch. SaveToFile ('. \ test. The zip ') when I was stuck,
The Arch. SetProgressCallback (nil, ProgressCallback);
The Arch. SetPassword (' 123456 ');
For the Counter:=0 to OpenDialog. Files. Do the Count - 1
The Arch. The AddFile (OpenDialog. Files/Counter,
ExtractFileName (OpenDialog Files (Counter)));
SetCompressionLevel (Arch, 5);
SetCompressionMethod (Arch, m7Deflate64);
The Arch. SaveToFile ('. \ test. ZIP ');
MemoOutput. Lines. Append (' complete compression);
The Arch:=nil;
The end;

CodePudding user response:

Online, etc.,,,,,,,,,,,

CodePudding user response:

Delphi XE2 + bring TZipFile class, and it is the native implementation, do not rely on external DLLS,


CodePudding user response:

D7, Zipb unit, which can be easy to operate, ZIP
Third party fitting VclZip, newsroom powerful,

CodePudding user response:

The modest, word wrong,

D7, Zipb unit, which can be easy to operate, ZIP
The third party controls VclZip, more powerful,

CodePudding user response:

Used, it is recommended that the encryption algorithm can change a ZIP format, SDK you have special instructions for ZIP encryption?
SetCompressionMethod (Arch, m7Deflate64); -- -- -- -- -- - the ZIP 64 encryption algorithm, is supported?
  • Related