Xceed Zip allows you to compress blocks of memory into files in a zip file. To accomplish this, perform the following 6 steps:
Specify the zip file to create or add files to. To do this, set the ZipFilename property.
If you also have real files to zip up as well as blocks of memory, you must specify these real files. To do this, set the FilesToProcess property.
Provide the filename(s) and file information for the block(s) of memory to compress into the zip file. To do this, write a handler for the QueryMemoryFile event.
Tell Xceed Zip to start zipping. To do this, call the Zip method.
Provide the data for the filename(s) you specified to compress from memory. To do this, write a handler for the ZippingMemoryFile event.
Make sure it worked successfully. To do this, check the Zip method's return value.
Below you will find a VB, Delphi and C# examples.
Here is sample code for these 6 steps (excluding the code for the QueryMemoryFile and ZippingMemoryFile events):
Visual Basic
Copy Code
' Don't forget to put an Xceed Zip control on a form Dim ResultCode As xcdError