Delphi Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
NTLM
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

Unzip with Progress Monitoring

Download Chilkat Zip ActiveX (includes objects for .zip, .gz, .bz2, and .Z)

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;

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · XML Parser