officefileapi-15247-zip-compression-and-archive-api-examples-how-to-unzip-an-archive.md
This example illustrates how to load the zip file and extract it to the specified directory. If the target directory is not specified, the current directory is the target.
using DevExpress.Compression;
public void UnzipArchive() {
string pathToZipArchive = "Documents\\Example.zip";
string pathToExtract = "Documents\\!Extracted";
using (ZipArchive archive = ZipArchive.Read(pathToZipArchive)) {
foreach (ZipItem item in archive) {
item.Extract(pathToExtract);
}
}
}
Imports DevExpress.Compression
Public Sub UnzipArchive()
Dim pathToZipArchive As String = "Documents\Example.zip"
Dim pathToExtract As String = "Documents\!Extracted"
Using archive As ZipArchive = ZipArchive.Read(pathToZipArchive)
For Each item As ZipItem In archive
item.Extract(pathToExtract)
Next item
End Using
End Sub