gpt4 book ai didi

c++ - QuaZip - 受密码保护的文件

转载 作者:行者123 更新时间:2023-11-28 06:07:17 31 4
gpt4 key购买 nike

我正在查看从 .zip 中提取受密码保护的文件,发现 QuaZip 具有以下功能,但没有关于如何处理加密文件的代码示例或其他文档。

QuaZip 中的加密文件一定可以解压吗?如果是,请提供一些示例:)

bool open (OpenMode mode, const char *password)

Opens a file for reading.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Argument password specifies a password to decrypt the file. If it is NULL then this function behaves just like open(OpenMode).

References open().

Referenced by open().

QuaZip Docs

最佳答案

试试这个:

QuaZip zip("file.zip"); // put real zip file name here
zip.open(QuaZip::mdUnzip);
QuaZipFile file(&zip);
for(bool f=zip.goToFirstFile(); f; f=zip.goToNextFile()) {
file.open(QIODevice::ReadOnly, "password"); // put real password here
file.readData(data, maxSize);
// process data from archive
file.close();
}
zip.close();

关于c++ - QuaZip - 受密码保护的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32137725/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com