天软金融分析.NET函数大全 > TSL函数 > 压缩和解压函数

ZipCompress    

简述
将文件压缩到ZIP文件中,如果压缩文件不存在,函数会创建一个。ZIP格式的压缩不支持加密。
定义
ZipCompress(zip_alias:string; zip_filename:string; alias:string; filename:string; path:string):Boolean;
参数
名称类型说明
zip_aliasstring字符串,ZIP文件的目录别名
zip_filenamestring字符串,ZIP文件名称
aliasstring字符串,被压缩文件的目录别名
filenamestring字符串,文件名称
pathstring字符串,文件在ZIP文件中的路径
返回Boolean;为1表示成功,0表示失败。
  • 范例

    //把文件d:\a.txt压缩到d:\a.zip文件中的/hello/world/a.txt中
    ZipCompress('', 'd:\\a.zip', '', 'd:\\a.txt', 'hello/world/a.txt');
    //将d:\tmp目录压缩到d:\a.zip文件中
    ZipCompress('', 'd:\\a.zip', '', 'd:\\tmp', 'test');

相关