C++ 解压zip利器

Zip Utils - clean, elegant, simple, C++/Win32

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;
}

posted on 2011-03-25 11:00  lartely  阅读(2065)  评论(0编辑  收藏  举报

导航