.NET Zip component, Delphi Zip component, Barcode .NET, BDE Replacement and other .NET and Delphi components from ComponentAce
Products Download Order Contact us

Search
 

Delphi/C++ Components
.NET Components
ActiveX Controls
Kylix Components

Download

Download
Download Commercial
Trial Limitations

Support

Submit Request
Support Options

Order

Purchase
Competitive Upgrade
Premium Support
Sales Policy
Upgrade Policy
License Types

Info

News
Mailing List
Articles
Testimonials



About Us
Partners
Links
Contact Us
Link to Us





Home > Delphi/C++ Components > ZipForge > ZipForge Transactions in Delphi

Delphi Zip Component ZipForge

Overview | Features | Requirements | Testimonials | Manual | Code Samples | Download | Order
ZipForge Transactions in Delphi
This sample shows how use ZipForge transactions.

Download ZipForge | Learn More | All Delphi samples
unit uMain;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, ZipForge;

type
  TfmMain = class(TForm)
    bnStart: TBitBtn;
    BitBtn2: TBitBtn;
    Label1: TLabel;
    Archiver: TZipForge;
    procedure bnStartClick(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmMain: TfmMain;

implementation

{$R *.DFM}

procedure TfmMain.bnStartClick(Sender: TObject);
begin
 with Archiver do
    begin
        FileName := 'Archive\test.zip';

        // Create a new archive file
        OpenArchive(fmCreate);

        // Start a transaction
        BeginUpdate;

        // Set path to folder with some HTML files to BaseDir
        BaseDir := 'Source';

        // Add all files from Source folder to the archive
        try
          AddFiles('*.*');
        except

          // If errors occur rollback transaction. All modifications will be cancelled.
          CancelUpdate;

          // Close archive and exit current procedure
          CloseArchive;
          ShowMessage('Error adding all files');
          Exit;
        end;

        // Set path to folder with some HTML files to BaseDir
        BaseDir := 'Source1\';

        // Add all HTML files from Source1 folder to the archive
        try
          AddFiles('*.htm*');
        except

          // If errors occurs rollback transaction. All modifications will be cancelled.
          CancelUpdate;

          // Close archive and exit current procedure
          CloseArchive;
          ShowMessage('Error adding html files');
          Exit;
        end;

        // Commit a transaction. All modifications will be saved.
        EndUpdate;

        // Set path to destination folder
        BaseDir := 'Dest';

        // Extract all files
        ExtractFiles('*.*');

        // Close the archive
        CloseArchive;
    end;
    ShowMessage('All files were added and extracted successfully.');
end;

procedure TfmMain.BitBtn2Click(Sender: TObject);
begin
 Close;
end;

end.



Download ZipForge | Learn More | All Delphi samples


Product Info


Current version: 6.91
Released: June 15, 2017
Price: $ 69

downloadorder


Our Customers



Testimonials

Component Ace is all that it advertises. It is easy to implement and is very fast.

In addition, the customer support is the best I have ever had. All my questions were answered within hours, often immediately. The responses also answered my questions, no need for followup emails.

If your application needs the functionality that Component Ace provides, search no further.

Linda Murphy

        © 2003 - 2017 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Dec 15, 2017