Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual C++ Examples

CkString
Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

 

 

Iterate Over Files in a Zip Archive

Download Chilkat C++ Libraries for VC++ 8.0 / Win32

Download Chilkat C++ Libraries for VC++ 7.0 / Win32

Download Chilkat C++ Libraries for VC++ 6.0 / Win32

Demonstrates how to iterate over the contents of a Zip compression archive.

// Visual C++ Example Source Code to open a Zip file and iterate
// over the contents.
//

#include "stdafx.h"
#include <stdio.h>

#include "CkZip.h"
#include "CkZipEntry.h"
#include "CkString.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    freopen("stdout.txt","w",stdout);

    // Unlock the Zip product.
    // This only needs to be done once when the first CkZip object
    // is instantiated.
    CkZip zip;
    zip.UnlockComponent("unlockCode");

    // Create a new Zip and append files and directories recursively.
    zip.OpenZip("tree.zip");
    
    // Iterate over the entries in the Zip.
    CkZipEntry *entry = zip.FirstEntry();
    CkString sFilename;
    while (entry)
	{
	// Print the filename, and the uncompressed and compressed sizes.
	entry->get_FileName(sFilename);
	printf("%s, %d, %d\n",sFilename.getString(),
	    entry->get_UncompressedLength(),entry->get_CompressedLength());

	CkZipEntry *temp = entry;
	entry = entry->NextEntry();
	delete temp;
	}

    zip.CloseZip();

    return 0;
}



 

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Mail Component · XML Parser