Xceed Zip for COM/ActiveX on x86/x64 Documentation
Example topics
/ Unzip method example for Delphi
In This Topic
Unzip method example for Delphi
In This Topic
The following code uses the Unzip method to unzip the file "readme.txt" from the zip file "c:\test\my test.zip" into the directory "c:\test\unzipped files". If the directory does not already exist, it will be created automatically. You should check the Unzip method's return value once you are done – if it is xerSuccess
, the operation was successful. Otherwise, look up the error code in the error codes list to find out what went wrong. This code assumes you have a button and an Xceed Zip control on a form, named Button1 and XceedZip1 respectively.
Delphi
Copy Code
procedure TForm1.Button1Click(Sender: TObject);
var ResultCode: xcdError; begin XceedZip1.License( 'your license key' );
{ All properties keep their default values except the four below } XceedZip1.FilesToProcess := 'readme.txt'; { The file to unzip } XceedZip1.PreservePaths := False;
{ In case file is stored in the zip file with a path, we need to make } {sure the path is removed so that the file will match with 'readme.txt' }