Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Zip Compress In-Memory Data into a Zip ArchiveThis 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.