System.IO.Compression 4.0.0.0 System.Object

A zip archive contains an entry for each compressed file. The class enables you to examine the properties of an entry, and open or delete the entry. When you open an entry, you can modify the compressed file by writing to the stream for that compressed file. You open an entry by calling the method.

If you reference the System.IO.Compression.FileSystem assembly in your project, you can access two extension methods for the class. Those methods are and , and they enable you to decompress the contents of the entry to a file. The System.IO.Compression.FileSystem assembly is not available in win8. In win8_appname_long apps, you can decompress the contents of an archive by using or , or you can use the wrt types Compressor and Decompressor to compress and decompress files.

You can retrieve an entry either by iterating through the collection in , or by calling the method in . You can create a new entry by calling or .

Represents a compressed file within a zip archive.

- Constructor
  4.0.0.0
  To be added.
  To be added.
- Property
  4.0.0.0
  System.IO.Compression.ZipArchive To be added. To be added.

  Gets the zip archive that the entry belongs to.

- Property
  4.0.0.0
  System.Int64 To be added.

  This property cannot be retrieved when the mode is set to , or the mode is set to and the entry has been opened.

  Gets the compressed size of the entry in the zip archive.

- Method
  4.0.0.0
  System.Void To be added.

  Deletes the entry from the zip archive.

- Property
  4.0.0.0
  System.String To be added.

  The property contains the relative path, including the subdirectory hierarchy, of an entry in a zip archive. (In contrast, the property contains only the name of the entry and does not include the subdirectory hierarchy.) For example, if you create two entries in a zip archive by using the method and provide NewEntry.txt as the name for the first entry and AddedFolder\\NewEntry.txt for the second entry, both entries will have NewEntry.txt in the property. The first entry will also have NewEntry.txt in the property, but the second entry will have AddedFolder\\NewEntry.txt in the property.

  You can specify any string as the path of an entry, including strings that specify invalid and absolute paths. Therefore, the property might contain a value that is not correctly formatted. An invalid or absolute path might result in an exception when you extract the contents of the zip archive.

  Gets the relative path of the entry in the zip archive.

- Property
  4.0.0.0
  System.DateTimeOffset To be added.

  When you create a new entry from an existing file by calling the method, the property for the entry is automatically set to the last time the file was modified. When you create a new entry programmatically by calling the method, the property for the entry is automatically set to the time of execution. If you modify the entry, you must explicitly set the property if you want the value to reflect the time of the latest change.

  When you set this property, the value is converted to a timestamp format that is specific to zip archives. This format supports a resolution of two seconds. The earliest permitted value is 1980 January 1 0:00:00 (midnight). The latest permitted value is 2107 December 31 23:59:58 (one second before midnight). If the value for the last write time is not valid, the property returns a default value of 1980 January 1 0:00:00 (midnight).

  Gets or sets the last time the entry in the zip archive was changed.

- Property
  4.0.0.0
  System.Int64 To be added.

  This property cannot be retrieved when the mode is set to , or the mode is set to and the entry has been opened.

  Gets the uncompressed size of the entry in the zip archive.

- Property
  4.0.0.0
  System.String To be added.

  The property contains the portion of the property that follows the final directory separator character (\), and does not include the subdirectory hierarchy. For example, if you create two entries in a zip archive by using the method and provide NewEntry.txt as the name for the first entry and AddedFolder\\NewEntry.txt for the second entry, both entries will have NewEntry.txt in the property. The first entry will also have NewEntry.txt in the property, but the second entry will have AddedFolder\\NewEntry.txt in the property.

  Gets the file name of the entry in the zip archive.

- Method
  4.0.0.0
  System.IO.Stream

  You use this method to access the stream for an entry in a zip archive. After retrieving the stream, you can read from or write to the stream. When you write to the stream, the modifications you make to the entry will appear in the zip archive.

  Opens the entry from the zip archive.

  The stream that represents the contents of the entry.