VB.NET Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB.NET Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML to XML
HTTP
IMAP
Encryption
MHT / HTML Email
PFX
RSA Encryption
S/MIME
Socket
Spider
Tar Archive
Upload
XML
XMP
Zip Compression
Misc

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

Byte Array
VB.NET FTPS
System.IO

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

 

 

 

 

 

 

Rename Files before Unzipping

How to rename files before unzipping. The .zip is opened, the filenames are updated (in memory) so that when the .zip is unzipped, the filenames are different. The original .zip is unmodified.

Download Chilkat .NET for 2.0 Framework

Download Chilkat .NET for 1.0 / 1.1 Framework

'  
Dim zipObj As New Chilkat.Zip

        zipObj.UnlockComponent("Anything for 30-day trial")

        ' Open a zip archive containing:
        ' inv.dbf
        ' cust.dbf
        ' rpt.dbf
        ' test.xml
        ' junk.txt
        Dim success As Boolean
        success = zipObj.OpenZip("testData.zip")
        If (Not success) Then
            MessageBox.Show(zipObj.LastErrorText)
            Exit Sub
        End If

        ' Loop over the entries and rename all files ending in .dbf:
        Dim n As Integer
        Dim i As Integer
        Dim entry As Chilkat.ZipEntry
        n = zipObj.NumEntries
        For i = 0 To n - 1
            entry = zipObj.GetEntryByIndex(i)
            If (entry.FileName.EndsWith(".dbf")) Then
                entry.FileName = entry.FileName.Replace(".dbf", "01.dbf")
            End If
        Next

        ' Now unzip all .dbf files:
        n = zipObj.UnzipMatching("unzipDir", "*.dbf", False)
        If (n < 0) Then
            MsgBox(zipObj.LastErrorText)
        Else
            MsgBox(n.ToString() & " files unzipped!")
        End If

	' These files are created: cust01.dbf, rpt01.dbf, inv01.dbf

 

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

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

Mail Component · XML Parser