Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Unzip with Progress Monitoring
Delphi example program to open a .zip file and unzip, with percent-done progress monitoring callbacks. // Unzip with progress monitoring. procedure TForm1.Button2Click(Sender: TObject); var saveExtraPath: Integer; success: Integer; begin ChilkatZip21.UnlockComponent('anything for 30-day trial'); // Open an existing .zip file. success := ChilkatZip21.OpenZip('test.zip'); if (success = 0) then begin ChilkatZip21.SaveLastError('zipErrorLog.txt'); ShowMessage(ChilkatZip21.LastErrorText); end else begin // Unzip to a sub-directory relative to the current working // directory of the calling process. The "abc123" directory // is created if it does not already exist, and all files // are unzipped within it. If the zip contains a directory tree, // the directory tree will be re-created on disk during the unzipping. ChilkatZip21.Unzip('abc123'); end; end; // Called each time the percent-done value changes. procedure TForm1.ChilkatZip21UnzipPercentDone(ASender: TObject; percentDone: Integer; out abort: Integer); begin // percentDone holds a value from 1 to 100. ProgressBar1.Position := percentDone; // To abort the unzip, set the abort argument equal to 1 and return. // The commented-out code aborts after the unzip is 50% complete. //if (percentDone >= 50) then //abort := 1; end;
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.