unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
VCLUnZip, VCLZip, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
VCLZip1: TVCLZip;
VCLUnZip1: TVCLUnZip;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
with VclZip1 do
begin
FilesList.Clear;
FilesList.Add('D:/VSource/resize/*.*');
ZipName:='D:/Temp/Test.ZIP';
Zip;
ShowMessage('OK');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
with VclUnZip1 do//用VclZip1就可以了,VclZip已经包含VclUnZip的所有属性和方法了
begin
ZipName:='D:/Temp/Test.ZIP';
ReadZip;
DoAll:=True;
DestDir:='D:/Temp';
RecreateDirs := False;
RetainAttributes := True;
ReplaceReadOnly := True;
UnZip;
ShowMessage('OK');
end;
end;
end.
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
VCLUnZip, VCLZip, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
VCLZip1: TVCLZip;
VCLUnZip1: TVCLUnZip;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
with VclZip1 do
begin
FilesList.Clear;
FilesList.Add('D:/VSource/resize/*.*');
ZipName:='D:/Temp/Test.ZIP';
Zip;
ShowMessage('OK');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
with VclUnZip1 do//用VclZip1就可以了,VclZip已经包含VclUnZip的所有属性和方法了
begin
ZipName:='D:/Temp/Test.ZIP';
ReadZip;
DoAll:=True;
DestDir:='D:/Temp';
RecreateDirs := False;
RetainAttributes := True;
ReplaceReadOnly := True;
UnZip;
ShowMessage('OK');
end;
end;
end.