如何使用 Infozip 来解压zip文件,需要的功能只是列表 zip 文件的文件树结构,和从中解压文件的功能(解压的文件或内存);因为我的程序是一个非 MFC 的 C 程序,所以不能使用那些现成的 MFC 类,只能直接调用 infozip 的库完成,高手门可有相关的代码?

解决方案 »

  1.   

    参考http://book.hackbase.com/ask28/how197858.htm
      

  2.   

    可以使用 zlib 
    http://www.zlib.net/manual.html
    使用解压缩
    int uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
      

  3.   

    个人推荐使用 zlib (http://www.zlib.net/)可以有C/C++/C#等版本
      

  4.   

    zlib 好像没有直接对文件进行操作的函数吧?我这个是要对文件进行操作,所以选择 infozip。To CathySun118(斯年):你这个还是封装的类。
      

  5.   

    还是希望能有 infozip 的处理方法
      

  6.   

    zlib的完整库中,有一个minizip,里面有完整的C示例,压缩、解压、密码等功能。
      

  7.   

    to:ljyit(木瓜) 这个例子是 minigzip,处理的是 .gz 格式的,不能处理 .zip  文件……
      

  8.   

    关注,没搞过解压缩还没见过味精封装的,搞不好要自己动手了看ZIP文件相关数据结构吧。
      

  9.   

    这个例子是 minigzip,处理的是 .gz 格式的,不能处理 .zip 文件……
    ================
    Minizip: Zip and UnZip additionnal library
    ----------------
    This package enables to extract files from a .zip archive file. It is compatible with PKZip 2.04g, WinZip, InfoZip, MimarSinan Codex Suite 2002 tools, and compatible sofware.
    It runs both under Linux and Windows, and probably other systems too. Encryption, multi-volume Zip files (span), and old compression methods used by old PKZip 1.x are not supported.Now, with version 1.23 and 1.14 of zLib, the Minizip library is inlucded in the contrib/minizip directory.
      

  10.   

    我做解压缩用的是外部工具,在程序中创建一个进程调用Rar.exe来解压缩,楼主要是不在程序中变成就可以调用一个工具来完成!