VB example Delphi example VC++ example
The Zip method compresses and stores files into a new or existing zip file.
The zip file to be written to must be specified by setting the ZipFilename property. When you run the Zip method, if the specified zip file does not exist, a new one will be created.
The files to zip up must be specified by setting the FilesToProcess property.
Declaration (ActiveX) | |
---|---|
Method Zip() As xcdError |
Declaration (DLL API) | |
---|---|
int XzZip( HXCEEDZIP hZip ) |
A return value of type xcdError is returned. Only the return value of xerSuccess indicates that the method has been completed successfully. See the error codes topic for a list of possible return values.
If one or more files to zip up already exist in the zip file being written to, the files already in the zip file will be replaced with new ones - unless one of the filtering properties causes the file to be excluded from processing.
To encrypt the contents of the zip file, the EncryptionPassword property must be set. If neither the EncryptionMethod or EncryptionStrength properties have been set, the zip file will be encrypted using the "standard" zip file encryption. To encrypt the zip file using WinZip AES compatible encryption algorithm, the EncryptionMethod property must be set to xemWinZipAES and the EncryptionStrength property set to the desired encryption strength, by default 256 bits.
Abort, BasePath, CompressionLevel, DeleteZippedFiles, EncryptionPassword, EncryptionMethod, EncryptionStrength, FilesToProcess and the filtering properties, SplitSize, PreservePaths, ProcessSubfolders, the SkipIf* properties, TempFolder, UseTempFile, ZipFilename, SpanMultipleDisks, ExtraHeaders, ZipOpenedFiles and the Sfx* properties.
ZipPreprocessingFile, DeletingFile, FileStatus, GlobalStatus, QueryMemoryFile, InsertDisk, DiskNotEmpty, ZipComment, ZippingMemoryFile, Warning, SkippingFile, InvalidPassword, and ProcessCompleted.
If you want to create spanned zip files , refer to the SpanMultipleDisks property.
Do you want to preserve existing files?Set the SkipIfExisting property to true.