|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- function ZipDir(zipMode{0-连同目录一起压缩,1-压缩指定目录中的所有文件和文件夹}:Integer;ZipControl:TVCLZip;MyZipName,MyZipDir:string):Boolean;
- begin
- {压缩指定目录中的所有文件和文件夹,指定RootDir,否则连同指定目录本身一同压缩}
- Result:=False;
- try
- with zipControl do
- begin
- case zipMode of
- 0:RootDir:='';
- 1:RootDir:=MyZipDir;
- end;
- OverwriteMode:=Always;
- AddDirEntriesOnRecurse:=True;
- RelativePaths:=True;
- //Recurse:=True;
- //RecreateDirs:=True;
- //StorePaths:=True;
- ZipName:=MyZipName;
- FilesList.Add(MyZipDir+'\*.*');
- Zip;
- Result:=True;
- end;
- except
- end;
- end;
复制代码
|
|