用法如下:
With TZip do
begin
ZipName := filepath+'temp.zip';
FilesList.Add(filepath+'temp.mdb');
Recurse := True;
StorePaths := false;
PackLevel := 9;
Zip;
end;
//
With vclUnzip1 do
begin
ZipName := opendialog.filename;
ReadZip;
//检测是否为需要的文件名
for J:=0 to Count-1 do
begin
if FileIsOk[J] then
if FullName[J]<>'temp.mdb' then
begin
showmessage('选择的文件内容错误,请重试!');
exit;//??
end
end;
//设置解压缩
DoAll := true;
DestDir := filepath;
RecreateDirs := False;
RetainAttributes := True;
//获得解压缩结果
descint:=Unzip;
if descint>0 then
With TZip do
begin
ZipName := filepath+'temp.zip';
FilesList.Add(filepath+'temp.mdb');
Recurse := True;
StorePaths := false;
PackLevel := 9;
Zip;
end;
//
With vclUnzip1 do
begin
ZipName := opendialog.filename;
ReadZip;
//检测是否为需要的文件名
for J:=0 to Count-1 do
begin
if FileIsOk[J] then
if FullName[J]<>'temp.mdb' then
begin
showmessage('选择的文件内容错误,请重试!');
exit;//??
end
end;
//设置解压缩
DoAll := true;
DestDir := filepath;
RecreateDirs := False;
RetainAttributes := True;
//获得解压缩结果
descint:=Unzip;
if descint>0 then
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货