Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ZipArchive.Extract() Method

In This Article

Extract all archive items as files into the current directory.

Namespace: DevExpress.Compression

Assembly: DevExpress.Docs.v24.2.dll

NuGet Package: DevExpress.Document.Processor

#Declaration

public void Extract()

#Remarks

If the archive contains directories, the directory structure will be recreated in the current directory, and the current directory is considered to be the root directory. The ZipItem.Name property value becomes the file name of the extracted file.

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.

View Example

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);
        }
    }
}
See Also