Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VB Examples

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

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


VB Strings
VB Byte Array

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

 

 

 

 

 

 

 

Zip Compress In-Memory Data into a Zip Archive

Download Chilkat Zip ActiveX

This VB example shows how to create a Zip archive that contains "files" whose contents originate from in-memory data.

' Create a Zip compression archive containing entries
' that are compressed directly from memory.
Private Sub Command2_Click()
    
    ' Create a Chilkat Zip object
    Dim ZipFile As ChilkatZip2
    Set ZipFile = New ChilkatZip2
    
    ZipFile.UnlockComponent UnlockCode.Text
    
    ' Initialize the Zip object.  OutputZip.Text is a Text control
    ' containing the name of the Zip file that will be created.
    ZipFile.NewZip OutputZip.Text
    
    ' Add the data to the Zip object.
    Dim e As ChilkatZipEntry2
    Set e = ZipFile.AppendData("myData.txt", TextData.Text)
    
    If (e Is Nothing) Then
        MsgBox ZipFile.LastErrorText
        Exit Sub
    End If
          
    ' Compress and write to disk.
    success = ZipFile.WriteZipAndClose()
    If (success = 0) Then
        MsgBox ZipFile.LastErrorText
    Else
        MsgBox "Created Zip!"
    End If
    
    Set ZipFile = Nothing
    
    Exit Sub
    
End Sub

Private Sub Form_Load()
    OutputZip.Text = CurDir$ + "\memoryData.zip"
    
End Sub


 

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

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