MFC Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

MFC Examples

Bounced Mail
Bz2
Certificates/Keys
Charset
CSV
Diffie-Hellman
DKIM / DomainKey
DSA
Email Object
Encryption
FileAccess
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
MIME
NTLM
POP3
RSA
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
Zip
Amazon S3


 

 

 

 

 

 

 

 

List Files in a .zip

How to list files within a .zip

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
// Needs #include <CkZip.h>
// Needs #include <CkZipEntry.h>

    CkString strOut;

    CkZip zip;

    bool success;

    //  Any string unlocks the component for the 1st 30-days.
    success = zip.UnlockComponent("30-day trial");
    if (success != true) {
        strOut.append("Failed to unlock zip!\r\n");
        SetDlgItemText(IDC_EDIT1,strOut.getUnicode());
        return;
    }

    success = zip.OpenZip("a.zip");
    if (success != true) {
        strOut.append(zip.lastErrorText());
        strOut.append("\r\n");
        SetDlgItemText(IDC_EDIT1,strOut.getUnicode());
        return;
    }

    long n;

    //  Get the number of files and directories in the .zip
    n = zip.get_NumEntries();
    strOut.appendInt(n);
    strOut.append("\r\n");

    CkZipEntry *entry = 0;

    long i;
    for (i = 0; i <= n - 1; i++) {

        entry = zip.GetEntryByIndex(i);
        if (entry->get_IsDirectory() == false) {
            //  (the filename may include a path)
            strOut.append(entry->fileName());
            strOut.append("\r\n");
        }

        delete entry;
    }


    SetDlgItemText(IDC_EDIT1,strOut.getUnicode());

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

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