procedure TForm1.Button1Click(Sender: TObject);
var
FileCompressed,I: Integer;
FileName:String;
begin
if SaveDialog1.Execute then
begin
Zip1.ArchiveFile := SaveDialog1.FileName;
Zip1.DateAttribute := daFileDate; // default value
Zip1.StoredDirNames := sdRelative; // default value
Zip1.CompressMethod := cmDeflate; // default value
Zip1.FileSpec.Clear ;
for I := 0 to ListBox1.Items.Count - 1 do // Iterate
begin
Zip1.FileSpec.Add(ListBox1.Items[i]);
end; // for
FileCompressed := Zip1.Compress;
end;
end;
var
FileCompressed,I: Integer;
FileName:String;
begin
if SaveDialog1.Execute then
begin
Zip1.ArchiveFile := SaveDialog1.FileName;
Zip1.DateAttribute := daFileDate; // default value
Zip1.StoredDirNames := sdRelative; // default value
Zip1.CompressMethod := cmDeflate; // default value
Zip1.FileSpec.Clear ;
for I := 0 to ListBox1.Items.Count - 1 do // Iterate
begin
Zip1.FileSpec.Add(ListBox1.Items[i]);
end; // for
FileCompressed := Zip1.Compress;
end;
end;
0 评论:
发表评论