The QuickUnzip method presents a quick and easy way to decompress a given zip archive to a source directory on disk. It combines the two operations of Open and Unzip. The source can be a filename or compressed stream. The destination is a path on disk.
To quickly and easily unzip a file archive to a path on disk:
C# |
Copy Code |
---|---|
archive1.PreservePath = true; archive1.Overwrite = Overwrite.Always; Archive1.QuickUnzip("c:\test.zip", "c:\Test"); |
Visual Basic |
Copy Code |
---|---|
Archive1.PreservePath = True Archive1.Overwrite = Always Archive1.QuickUnzip("c:\test.zip", "c:\Test") |
To unzip a compressed stream to a path on disk:
C# |
Copy Code |
---|---|
System.IO.FileStream stream = new System.IO.FileStream("c:\\test.zip", System.IO.FileMode.Open); archive1.QuickUnzip(stream, "c:\\Test"); |
Visual Basic |
Copy Code |
---|---|
Dim stream As New System.IO.FileStream("c:\test.zip", System.IO.FileMode.Open) Archive1.QuickUnzip(stream, "c:\Test") |
To unzip a file archive asynchronously:
C# |
Copy Code |
---|---|
archive1.BeginQuickUnzip("c:\\test.zip", "c:\\Test", null); ... private void archive1_EndUnzip(object sender, Dart.PowerTCP.Zip.EndEventArgs e) { try { if (e.Exception == null) MessageBox.Show("Extraction Complete!"); else MessageBox.Show(e.Exception.Message); } catch {} } |
Visual Basic |
Copy Code |
---|---|
Archive1.BeginQuickUnzip("c:\test.zip", "c:\Test", Nothing) ... Private Sub Archive1_EndUnzip(ByVal sender As Object, ByVal e As Dart.PowerTCP.Zip.EndEventArgs) Handles Archive1.EndUnzip Archive1.EndZip Try If (e.Exception Is Nothing) Then MessageBox.Show("Extraction Complete!") Else MessageBox.Show(e.Exception.Message) End If Catch End Try End Sub |