PowerTCP Zip Compression for .NET
Unzip Method (Archive)
Example 




A directory that will contain the decompressed data files.
Decompresses the items in the current collection to the specified directory
Syntax
<DescriptionAttribute("To decompress the items in the current collection to a destination directory")>
Public Sub Unzip( _
   ByVal destination As String _
) 
Dim instance As Archive
Dim destination As String
 
instance.Unzip(destination)
[Description("To decompress the items in the current collection to a destination directory")]
public void Unzip( 
   string destination
)
[Description("To decompress the items in the current collection to a destination directory")]
public: void Unzip( 
   string* destination
) 
[Description("To decompress the items in the current collection to a destination directory")]
public:
void Unzip( 
   String^ destination
) 

Parameters

destination
A directory that will contain the decompressed data files.
Exceptions
ExceptionDescription
ZipExceptionA critical zip operation error occurred during this activity. Please see ZipException.Message for details.
Remarks

The PreservePath property determines whether to preserve the paths and 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 you would like to unzip an item to a stream, ArchiveItem.Unzip can be used for such a purpose.

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

Example
The following example demonstrates loading a compressed file and unzipping the file.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip"
' at the top of your class.

' Open a compressed stream.  This populates the Archive collection.
Archive1.Open("c:\test.zip")

' Preserve the path structure and overwrite any existing files.
Archive1.PreservePath = True
Archive1.Overwrite = Overwrite.Always

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

// Open a compressed stream.  This populates the Archive collection.
archive1.Open("c:\\test.zip");

// Preserve the path structure and overwrite any existing files.
archive1.PreservePath = true;
archive1.Overwrite = Overwrite.Always;

// Unzip to c:\test
archive1.Unzip("c:\\Test");
See Also

Reference

Archive Class
Archive Members


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