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

Extract a Single File from a RAR Archive

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)

Demonstrates how to open a RAR archive and extract a single file at a time.

Note: The Chilkat RAR ActiveX objects are included in the "Chilkat Zip" ActiveX download. The RAR functionality contained within ChilkatZip2.dll is freeware, however, the Chilkat Zip, GZip, and .Z functionality is not freeware.

The Chilkat RAR for .NET and C++ are bundled in downloads that contain all Chilkat classes (both free and non-free). Make sure you select the download that matches your .NET Framework or VC++ version (6/7/8).

If running on x64, download the ActiveX, .NET, or C++ builds marked specifically for x64.

uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls,
    ChilkatZip2Lib_TLB,
    OleCtrls;

...

procedure TForm1.Button1Click(Sender: TObject);
var
rar: TChilkatRar;
success: Integer;
entry: IChilkatRarEntry;

begin
rar := ERROR;

//  Note: The Chilkat RAR functionality only provides the ability
//  to open, list, and "unrar" (i.e. extract) RAR archives.  It does
//  not provide the ability to create RAR archives.

//  Also, the Chilkat RAR functionality is free.  It does not
//  require a license to use indefinitely.

success := rar.Open('abc123.rar');
if (success <> 1) then
  begin
    ShowMessage(rar.LastErrorText);

  end;

//  Entries within the RAR can be accessed by name or by index.

entry := rar.GetEntryByName('HelloWorld123.txt');
if (entry = nil ) then
  begin
    ShowMessage(rar.LastErrorText);
  end
else
  begin
    success := entry.Unrar('c:/temp/unrarDest');
    if (success = 0) then
      begin
        ShowMessage(rar.LastErrorText);
      end
    else
      begin
        ShowMessage('Success.');
      end;
  end;

//  Alternatively, get an entry by index.  The first entry
//  is at index 0.
entry := rar.GetEntryByIndex(0);
if (entry = nil ) then
  begin
    ShowMessage(rar.LastErrorText);
  end
else
  begin
    success := entry.Unrar('c:/temp/unrarDest');
    if (success = 0) then
      begin
        ShowMessage(rar.LastErrorText);
      end
    else
      begin
        ShowMessage('Success.');
      end;
  end;


end;

 

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

Mail Component · .NET Email Component · XML Parser