VB example Delphi example VC++ example C# example VB.NET example
To zip up files, perform the following 4 steps. Put the Xceed Zip control on a form, then:
Specify the zip file to create or add files to. To do this, set the ZipFilename property.
Specify the files you want to zip up. To do this, set the FilesToProcess property.
Tell Xceed Zip to start zipping. To do this, call the Zip method.
Make sure it worked successfully. To do this, check the Zip method's return value.
The main questions you should ask yourself when zipping files are:
Do you want to store paths in the zip file? See the controlling how paths are stored topic.
Do you want to zip up files in subfolders, too? See the ProcessSubfolders property.
Do you want to display the status of the zipping operation? See the GlobalStatus event.
What if the zip file might span multiple disks? If so, write a handler for the InsertDisk event.
Do you want the zipped files to be deleted afterwards? See the DeleteZippedFiles property.
Other questions you may want to consider are:
Do you want to use the BZip2 compression method? See the CompressionMethod property.
Do you want to zip only certain types of files? See the filtering properties.
Do you want to password-protect your zipped files? See the EncryptionPassword property.
Do you want to edit a file's info before zipping? See the ZipPreprocessingFile event.
Is there a chance you're zipping files already open? See the ZipOpenedFiles property.
Are you looking for the best compression ratio? See the CompressionLevel property.
Do you want to store Unicode file names in the zip file? See the ExtraHeaders property.
If there's anything else you need to do that's not mentioned here, consult the Properties topic, or search the index – chances are, Xceed Zip does what you need. If not, ask Xceed Software whether it is possible or not.