我们可以使用 minizip 为 zip 文件设置密码吗 [英] can we set password for zip file using minizip

查看:68
本文介绍了我们可以使用 minizip 为 zip 文件设置密码吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 minizip 为 zip 文件设置密码.我没有找到相关文档.我知道我们可以加密所有压缩文件.

I want to set password for zip files using minizip.I didn't find an documentation regarding this.I know we can encrypt all the zipped file.

推荐答案

/contrib/minizip 目录中提供了使用 C 代码的完整示例:minizip.c 用于压缩,miniunzip.c 用于解压.正如之前的评论中所说 zipOpenNewFileInZip3 用于使用密码进行压缩.要解压,您必须使用 unzOpenCurrentFilePassword 打开压缩文件.

A complete example using C code is provided in the /contrib/minizip directory: minizip.c for the compression, miniunzip.c for the decompression. As said in the previous comment zipOpenNewFileInZip3 is for compression with password. For decompression you have to open the zipped file(s) with unzOpenCurrentFilePassword.

这篇关于我们可以使用 minizip 为 zip 文件设置密码吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆