อาจารย์ครับ
TSevenZip คือ อะไรครับ
ขอคำแนะนำด้วยครับ
ขอบคุณครับ
ไม่ทราบว่าใช่เปล่านะครับ ให้ลองดูครับ
http://www.componentace.com/extract-file-from-zip-in-delphi.htm//zip file
begin
//
archiver := TZipForge.Create(nil);
try
with archiver do
begin
// Set the name of the archive file we want to create
FileName := 'C:\test.zip';
// Because we create a new archive,
// we set Mode to fmCreate
OpenArchive(fmCreate);
// Set base (default) directory for all archive operations
BaseDir := 'C:\';
// Add the c:\Test folder to the archive with all subfolders
AddFiles('C:\Test\*.*');
CloseArchive();
end;
except
on E: Exception do
begin
Writeln('Exception: ', E.Message);
// Wait for the key to be pressed
Readln;
end;
//
end;
end;
//unzip
begin
begin
// Create an instance of the TZipForge class
archiver := TZipForge.Create(nil);
try
with archiver do
begin
// The name of the ZIP file to unzip
FileName := 'C:\test.zip';
// Open an existing archive
OpenArchive(fmOpenRead);
// Set base (default) directory for all archive operations
BaseDir := 'C:\temp';
// Extract all files from the archive to C:\Temp folder
ExtractFiles('*.*');
CloseArchive();
end;
except
on E: Exception do
begin
Writeln('Exception: ', E.Message);
// Wait for the key to be pressed
Readln;
end;
end;
end;
end;