chilkat库操作zip的函数比较多,满足我们基础需求,以下是操作zip文件的实例
#include <iostream>
#include "allUnicode.h"
int main()
{
CkZipW *pZip = CkZipW::createNew();
if (pZip->UnlockComponent(L"jTriol.ZP10899_uxBpnxxxxx"))
{
pZip->OpenZip(L"C:\\Users\\14713\\Desktop\\11.zip");
//获取压缩包里面所有的目录和文件
CkZipEntryW *pZipEntryW = pZip->FirstEntry();
while (pZipEntryW != nullptr)
{
const wchar_t *fileName = pZipEntryW->fileName();
pZipEntryW = pZipEntryW->NextEntry();
}
//解压整个文件到指定目录
const wchar_t *dirPath = L"C:\\Users\\14713\\Desktop\\1";
pZip->Extract(dirPath);
pZip->CloseZip();
}
}