class ZipArchive

in global :: System . IO . Compression

Represents a package of compressed files in the zip archive format.


public ZipArchive( Stream stream )

Initializes a new instance of the class from the specified stream.

  • stream The stream that contains the archive to be read.

public ZipArchive( Stream stream, ZipArchiveMode mode )

Initializes a new instance of the class from the specified stream and with the specified mode.

  • stream The input or output stream.
  • mode One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries.

public ZipArchive( Stream stream, ZipArchiveMode mode, bool leaveOpen )

Initializes a new instance of the class on the specified stream for the specified mode, and optionally leaves the stream open.

  • stream The input or output stream.
  • mode One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries.
  • leaveOpen to leave the stream open after the object is disposed; otherwise, .

public ZipArchive( Stream stream, ZipArchiveMode mode, bool leaveOpen, Encoding entryNameEncoding )

Initializes a new instance of the class on the specified stream for the specified mode, uses the specified encoding for entry names, and optionally leaves the stream open.

  • stream The input or output stream.
  • mode One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries.
  • leaveOpen to leave the stream open after the object is disposed; otherwise, .
  • entryNameEncoding The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names.

public ZipArchiveEntry CreateEntry( string entryName )

Creates an empty entry that has the specified path and entry name in the zip archive.

  • entryName A path, relative to the root of the archive, that specifies the name of the entry to be created.
  • Returns An empty entry in the zip archive.

public ZipArchiveEntry CreateEntry( string entryName, CompressionLevel compressionLevel )

Creates an empty entry that has the specified entry name and compression level in the zip archive.

  • entryName A path, relative to the root of the archive, that specifies the name of the entry to be created.
  • compressionLevel One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry.
  • Returns An empty entry in the zip archive.

public ReadOnlyCollection<ZipArchiveEntry> Entries { get; }

Gets the collection of entries that are currently in the zip archive.

  • Returns The collection of entries that are currently in the zip archive.

public ZipArchiveEntry GetEntry( string entryName )

Retrieves a wrapper for the specified entry in the zip archive.

  • entryName A path, relative to the root of the archive, that identifies the entry to retrieve.
  • Returns A wrapper for the specified entry in the archive; if the entry does not exist in the archive.

public ZipArchiveMode Mode { get; }

Gets a value that describes the type of action the zip archive can perform on entries.

  • Returns One of the enumeration values that describes the type of action (read, create, or update) the zip archive can perform on entries.

public string Comment { get; set; }

😔 No documentation found.

public void Dispose( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.