Delphi Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML Conversion
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...
Amazon S3
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

TempDir Zip Property

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

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

Delphi example code to open a Zip archive, append a single file, and rewrite the .zip.

// Important information about the TempDir property.
{
  When the Chilkat Zip component writes a .zip file, it first
  writes a temporary .zip to the directory specified by the
  Zip.TempDir property.  The default value of TempDir is ".", which
  is the current working directory of the calling process.
  You should ensure that the calling process has permissions
  to create and/or write files in the TempDir.

  The TempDir is used to safeguard existing .zip files when
  rewriting.  The WriteZip and WriteZipAndClose methods write
  to a temporary .zip first, and if successful, renames it to
  the intended destination.  This ensures that existing .zip are not
  lost if the WriteZip method fails, or is aborted by the application.
}
procedure TForm1.Button6Click(Sender: TObject);
var
  recurse: Integer;
  success: Integer;

begin
  // UnlockComponent should be called once at the beginning of a program.
  ChilkatZip21.UnlockComponent('anything for 30-day trial');

  // Initialize the zip object.
  ChilkatZip21.NewZip('test.zip');

  // Add files...
  recurse := 1;
  ChilkatZip21.AppendFiles('c:/temp/abc/*', recurse);

  // Use c:\temp as our TempDir.
  ChilkatZip21.TempDir := 'c:\temp';

  success := ChilkatZip21.WriteZipAndClose();
  if (success = 0) then begin
      ChilkatZip21.SaveLastError('zipErrorLog.txt');
      ShowMessage(ChilkatZip21.LastErrorText);
  end;

  ShowMessage('Done!');

end;

 

 

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

Mail Component · .NET Email Component · XML Parser