VBScript Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

VBScript 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
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
POP3
SMTP
Byte Array
RSS
Atom

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

 

 

 

 

 

 

 

In-Memory Zip / Unzip Code

Demonstrates some features of using the Zip component entirely in-memory.

Download Chilkat Zip ActiveX

set zip = CreateObject("Chilkat.Zip2")

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

'  NewZip initializes the zip object.  It does not write
'  the file.  The "test.zip" file, in this case, will never be written.
success = zip.NewZip("test.zip")
If (success <> 1) Then
    MsgBox zip.LastErrorText
    WScript.Quit
End If

'  Append a string as a file within the zip object.

'  The last argument to AppendString2 is a charset name.
Set entry = zip.AppendString2("test.txt","This is a test 123 ABC 123 ABC","iso-8859-1")

'  zipImage is a byte array that contains a .zip file.
'  The WriteToMemory method writes the .zip to a byte array
'  instead of writing to a file.

zipImage = zip.WriteToMemory()

'  Now.. let's open the .zip from a byte array.
set zip2 = CreateObject("Chilkat.Zip2")

success = zip2.OpenFromMemory(zipImage)
If (success <> 1) Then
    MsgBox zip2.LastErrorText
    WScript.Quit
End If

'  Now get the test.txt entry:
Set entry = zip2.GetEntryByName("test.txt")
If (entry Is Nothing ) Then
    MsgBox "Failed to find test.txt"
    WScript.Quit
End If

'  Inflate the entry to a byte array:

entryBytes = entry.Inflate()

'  Inflate the entry to a string:

entryStr = entry.InflateToString2()

MsgBox entryStr


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

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

Mail Component · XML Parser