VB.NET Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
PFX
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

Byte Array
VB.NET FTPS
System.IO

 

 

 

 

 

 

Create Zip Excluding Files Matching Patterns

How to create a .zip archive excluding (skipping) files that match a set of wildcarded patterns.

Download: Chilkat .NET Assemblies

Dim zip As New Chilkat.Zip()

Dim success As Boolean

'  Any string unlocks the component for the 1st 30-days.
success = zip.UnlockComponent("Anything for 30-day trial")
If (success <> true) Then
    MsgBox(zip.LastErrorText)
    Exit Sub
End If


success = zip.NewZip("test.zip")
If (success <> true) Then
    MsgBox(zip.LastErrorText)
    Exit Sub
End If


'  Create a string array object with our set of filename patterns
'  to be excluded:
Dim sa As New Chilkat.StringArray()
sa.Append("*.bak")
sa.Append("*.tmp")

'  Tell the zip object to use these exclusions:
zip.SetExclusions(sa)

'  Append a directory tree.  The AppendFiles does
'  not read the file contents or append them to the zip
'  object in memory.  It simply appends references
'  to the files so that when WriteZip (or WriteZipAndClose,
'  or WriteExe, etc.) is called, the files are compressed
'  and encrypted.
Dim recurse As Boolean
recurse = true
zip.AppendFiles("c:/temp/a/*",recurse)


success = zip.WriteZipAndClose()
If (success <> true) Then
    MsgBox(zip.LastErrorText)
    Exit Sub
End If


MsgBox("Zip Created!")
 

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