ZipArchive::GetEntry Method (String^)

.NET Framework (current version)
 

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

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

public:
ZipArchiveEntry^ GetEntry(
	String^ entryName
)

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; null if the entry does not exist in the archive.

Exception Condition
ArgumentException

entryName is Empty.

ArgumentNullException

entryName is null.

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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show: