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
找到目录下的文件夹 并且进行压缩,然后再生成压缩文件到指定目录
最新推荐文章于 2023-05-25 11:29:12 发布
本文介绍如何在操作系统中查找特定目录下的所有文件夹,使用压缩工具进行压缩,并将生成的压缩文件移动到指定的目标目录。这对于数据管理和备份操作非常有用。
摘要由CSDN通过智能技术生成