Xceed Real-Time Zip for .NET Documentation
Zip(String,String[]) Method


Xceed.Zip Assembly > Xceed.Zip Namespace > QuickZip Class > Zip Method : Zip(String,String[]) Method
The fully-qualified path and name of the zip file.
The files to add to zipFileName. Can contain filemasks and folder names (ending with a backslash). All subfolders will also be scanned for the specified file(s) even if wildcards are not used. For example, if "C:\test.txt" is specified, all "test.txt" files found on the "C:\" drive will be added to the zip file. Folders specified with the backslash after them will include their entire contents. Cannot be a null reference (Nothing in Visual Basic).
Adds files recursively to a zip file overwriting existing files and preserving the directory structure.
Syntax
'Declaration
 
Public Overloads Shared Sub Zip( _

   ByVal zipFileName As String, _

   ByVal ParamArray filesToZip() As String _

) 
'Usage
 
Dim zipFileName As String

Dim filesToZip() As String

 

QuickZip.Zip(zipFileName, filesToZip)
public static void Zip( 

   string zipFileName,

   params string[] filesToZip

)

Parameters

zipFileName
The fully-qualified path and name of the zip file.
filesToZip
The files to add to zipFileName. Can contain filemasks and folder names (ending with a backslash). All subfolders will also be scanned for the specified file(s) even if wildcards are not used. For example, if "C:\test.txt" is specified, all "test.txt" files found on the "C:\" drive will be added to the zip file. Folders specified with the backslash after them will include their entire contents. Cannot be a null reference (Nothing in Visual Basic).
Remarks

If zipFileName does not exist, it will be created and then the files will be added.

Note that existing files will be overwritten, the directory structure will be preserved within the zip file and files contained within sub-folders will also be added to the zip file.

By default, Unicode and FileTimes extra headers are stored in the zip file when new items are added to the zip file. The extra headers of items that already exist in the zip file will not be modified.

All zip files will automatically be created in the Zip64 zip file format if the limitations of the regular Zip format are reached.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

QuickZip Class
QuickZip Members
Overload List