PowerTCP Zip Compression for .NET
QuickUnzip(String,String) Method
Example 




The name of the compressed file.
A directory path where decompressed files will be stored.
Opens a compressed archive and decompresses it in one step.
Syntax
<DescriptionAttribute("To unzip a given zip file to a specified directory.")>
Public Overloads Sub QuickUnzip( _
   ByVal source As String, _
   ByVal destination As String _
) 
Dim instance As Archive
Dim source As String
Dim destination As String
 
instance.QuickUnzip(source, destination)
[Description("To unzip a given zip file to a specified directory.")]
public void QuickUnzip( 
   string source,
   string destination
)
[Description("To unzip a given zip file to a specified directory.")]
public: void QuickUnzip( 
   string* source,
   string* destination
) 
[Description("To unzip a given zip file to a specified directory.")]
public:
void QuickUnzip( 
   String^ source,
   String^ destination
) 

Parameters

source
The name of the compressed file.
destination
A directory path where decompressed files will be stored.
Exceptions
ExceptionDescription
ZipExceptionA critical zip operation error occurred during this activity. Please see ZipException.Message for details.
Remarks

This method is a quick and easy way to use the Archive component to decompress a given compressed archive to a specified destination directory in one step. It combines the two operations of Archive.Open and Archive.Unzip.

The Archive.PreservePath property determines whether to preserve the paths. The Archive.Overwrite property determines whether and how an existing file will be overwritten. By default, the paths will not be preserved and the overwrite choice is Overwrite.Never. The Archive.Password property is used for decrypting the encrypted items.

If an error occurs for an individual item during this operation, the Archive.Exception Event will be raised.

Example
The following example demonstrates using QuickUnzip and specifying specific options. Only QuickUnzip is required in this operation.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip"
' at the top of your class.

' Preserve the path when unzipping
Archive1.PreservePath = True

' Overwrite any existing files
Archive1.Overwrite = Overwrite.Always

' Unzip all the files to c:\test
Archive1.QuickUnzip("c:\test.zip", "c:\Test")
// Be sure to import the namespace by putting "using Dart.PowerTCP.Zip;"
// at the top of your class.

// Preserve the path when unzipping
archive1.PreservePath = true;

// Overwrite any existing files
archive1.Overwrite = Overwrite.Always;

// Unzip all the files to c:\test
archive1.QuickUnzip("c:\\test.zip", "c:\\Test");
See Also

Reference

Archive Class
Archive Members
Overload List


PowerTCP Zip for .NET Documentation Version 2.1.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic