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.Read(String, Encoding, Boolean) Method

Static method that creates a ZipArchive instance from the archive file, uses the specified encoding for the zip item names and allows you not to catch exceptions when extracting a particular zip entry.

Namespace: DevExpress.Compression

Assembly: DevExpress.Docs.v24.2.dll

NuGet Package: DevExpress.Document.Processor

#Declaration

public static ZipArchive Read(
    string fileName,
    Encoding encoding,
    bool catchExceptions
)

#Parameters

Name Type Description
fileName String

A string that is the path to the archive file.

encoding Encoding

The Encoding object that specifies character encoding for the zip item names.

catchExceptions Boolean

True, to catch exceptions when extracting a particular zip entry and skip the problematic entry; otherwise, false.

#Returns

Type Description
ZipArchive

A ZipArchive instance that is the zip archive for modification or extraction.

#Remarks

The Read method override allows you not to skip problematic zip entries during archive extraction (default behavior), but to throw exceptions so they propagate up the call chain.

If you handle the ZipArchive.Error event in a problematic situation, the event occurs and subsequently, the exception is thrown.

Note

When the file archive is opened with the ZipArchive.Read method, you cannot save it to the same file because the original file is locked. The ZipArchive.Save method always attempts to create a new file overwriting the existing one.

See Also