Dart.PowerTCP.Zip Namespace > Archive Class > QuickZip Method : QuickZip(String,String) Method |
<DescriptionAttribute("To compress a given source with wildcard to a file")> Public Overloads Sub QuickZip( _ ByVal source As String, _ ByVal destination As String _ )
Dim instance As Archive Dim source As String Dim destination As String instance.QuickZip(source, destination)
[Description("To compress a given source with wildcard to a file")] public void QuickZip( string source, string destination )
[Description("To compress a given source with wildcard to a file")] public: void QuickZip( string* source, string* destination )
[Description("To compress a given source with wildcard to a file")] public: void QuickZip( String^ source, String^ destination )
Exception | Description |
---|---|
ZipException | A critical zip operation error occurred during this activity. Please see ZipException.Message for details. |
This method is a quick and easy way to use the Archive component to compress a given file or files to a specified destination file. It combines the two operations of Archive.Add and Archive.Zip.
The Archive.Password and Archive.Encryption properties are used for data encryption during the QuickZip operation. The Archive.PreservePath property determines whether to preserve paths for each file item. The Archive.IncludeSubs property determines whether to include the subdirectories. The Archive.ExcludePattern property determines the files to exclude.
If an error occurs for an individual item during this operation, the Archive.Exception Event will be raised.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip" ' at the top of your class. ' Preserve the path structure of the files Archive1.PreservePath = True ' Include any subdirectories Archive1.IncludeSubs = True ' Specify compression level Archive1.CompressionLevel = CompressionLevel.Medium ' Use the Deflate compression method Archive1.DefaultCompressionMethod = CompressionMethod.Deflate ' Exclude any text files Archive1.ExcludePattern = "*.txt" ' Set to use encryption Archive1.DefaultEncryption = Encryption.Standard ' Specify the password Archive1.Password = "testme" ' Perform the compression operation - this is the only required method for the operation Archive1.QuickZip("c:\\Test\\*.*", "c:\\test.zip")
// Be sure to import the namespace by putting "using Dart.PowerTCP.Zip;" // at the top of your class. // Preserve the path structure of the files archive1.PreservePath = true; // Include any subdirectories archive1.IncludeSubs = true; // Specify compression level archive1.CompressionLevel = CompressionLevel.Medium; // Use the Deflate compression method archive1.DefaultCompressionMethod = CompressionMethod.Deflate; // Exclude any text files archive1.ExcludePattern = "*.txt"; // Set to use encryption archive1.DefaultEncryption = Encryption.Standard; // Specify the password archive1.Password = "testme"; // Perform the compression operation - this is the only required method for the operation archive1.QuickZip("c:\\Test\\*.*", "c:\\test.zip");