delphi7关于文件夹压缩的问题.

来源:百度知道 编辑:UC知道 时间:2024/06/03 21:20:56
想压缩一个带有文件的文件夹,希望连同文件夹一起压缩.用zipvcl控件怎么实现?

procedure TForm1.RzBitBtn1Click(Sender: TObject);
var
FilesCompressed: Integer;
begin
Zip1.Switch := swAdd;
Zip1.FileSpec.Clear( );
Zip1.FileSpec.Add( 'E:\1\*.*' ); //要压缩的文件
Zip1.ArchiveFile := 'E:\11111.zip'; //压缩后的文件
FilesCompressed:= Zip1.Compress;

end;

右键单击文件夹
选择添加到压缩文档