Export (0) Print
Expand All

ZipArchive.GetEntry Method

.NET Framework 4.5

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

Namespace:  System.IO.Compression
Assembly:  System.IO.Compression (in System.IO.Compression.dll)

member GetEntry : 
        entryName:string -> ZipArchiveEntry

Parameters

entryName
Type: System.String

A path, relative to the root of the archive, that identifies the entry to retrieve.

Return Value

Type: System.IO.Compression.ZipArchiveEntry
A wrapper for the specified entry in the archive; a null reference (Nothing in Visual Basic) if the entry does not exist in the archive.

ExceptionCondition
ArgumentException

entryName is Empty.

ArgumentNullException

entryName is a null reference (Nothing in Visual Basic).

NotSupportedException

The zip archive does not support reading.

ObjectDisposedException

The zip archive has been disposed.

InvalidDataException

The zip archive is corrupt, and its entries cannot be retrieved.

If multiple entries that have the specified name exist in the archive, the first one is returned. The name of the entry is compared to entryName using ordinal comparison.

The following example shows how to use the GetEntry method to retrieve an entry.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1

Windows Phone 8.1, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft