unit uMainForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ioutils, Types, zip, Vcl.StdCtrls,
Vcl.ExtCtrls;
type
TForm2 = class(TForm)
LabeledEdit1: TLabeledEdit;
LabeledEdit2: TLabeledEdit;
LabeledEdit3: TLabeledEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
dfs : TStringDynArray;
strDirectory : string;
strFile : string;
begin
dfs := TDirectory.GetDirectories(self.LabeledEdit1.Text, self.LabeledEdit2.Text);
for strDirectory in dfs do
begin
strFile := (TPath.GetFileName(strDirectory));
TZipFile.ZipDirectoryContents(self.LabeledEdit3.Text + '\' + strFile + '.zip', strDirectory);
end;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
self.LabeledEdit1.Text := TPath.GetFullPath('.\');
self.LabeledEdit2.Text := '*';
self.LabeledEdit3.Text := TPath.GetFullPath('..\');
end;
end.
unit uMainForm;
interface
uses
Winapi.Windo