Visual C++ Examples

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

C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Email Object
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Create a Zip While Excluding Files Matching a Pattern

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

Demonstrates how to create a Zip while excluding files matching a pattern.

// Zip Compression C++ Source Code to
// add an entire directory tree to a Zip
// while excluding files matching a pattern.
//

#include "stdafx.h"

#include "CkZip.h"
#include "CkZipEntry.h"
#include "CkStringArray.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    // 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.NewZip("myZip.zip");
    
    // Exclude all of these types of files.
    CkStringArray sArray;
    sArray.Append("*.obj");
    sArray.Append("*.exe");
    sArray.Append("*.ncb");
    sArray.Append("*.db");

    // Add the exlusions.
    zip.SetExclusions(&sArray);

    // Also exclude directories named "Sounds", "Debug" and "Release", wherever found.
    zip.ExcludeDir("Debug");
    zip.ExcludeDir("Release");
    zip.ExcludeDir("Sounds");

    // Append the files, excluding everything we've specified.
    zip.AppendFiles("./Tree/*",true,0);
    zip.WriteZipAndClose(0);

    return 0;
}



 

 

 

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

Mail Component · .NET Mail Component · XML Parser