C++ 解压zip利器

 

Adding zip/unzip easily, no LIBS or DLLs, with an elegant and powerful API.

BOOL extractFile(void) 
{ 
    CString currentPath,fileName; 
    GetCurrentDirectory(currentPath); 
    fileName=L"****.zip"; 
    HZIP hz=OpenZip(currentPath+fileName,0); 
    ZIPENTRY ze;  
    GetZipItem(hz,-1,&ze);  
    int numitems=ze.index; 
    for (int zi=0; zi<numitems; zi++) 
         { ZIPENTRY ze; GetZipItem(hz,zi,&ze); // fetch individual details 
  
           UnzipItem(hz, zi, currentPath+ze.name);         // e.g. the item's name. 
  
          } 
    CloseZip(hz); 
    AddList(L"解压缩文件成功"); 
    return TRUE; 
}

你可能感兴趣的:(C++)