delphi中进行zip压缩解压缩
作者:高原 日期:2010-08-09
压缩:
vclzip:=TVCLZip.create(nil);
with vclzp do
begin
ZipName:=dstFile;
RecreateDirs:=true; //注意这里
StorePaths:=False;
FilesList.Add(srcFile);
Recurse := True;
try
Zip;
except
Application.MessageBox('压缩文件失败','错误',MB_OK+MB_ICONINFORMATION);
exit;
end;
end;
解压缩:
vcluzip:=TVCLUnZip.Create(nil);
with vcluzip do
begin
ZipName:=sFile;
ReadZip;
FilesList.Add('*.*');
DoAll := False;
DestDir := ExtractFilePath(sFile);
RecreateDirs := False;
RetainAttributes := True;
Unzip;
end;
vcluzip.Free;
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: