共用方式為


ZipArchive.GetEntry Method

Retrieves a wrapper for the file entry in the archive with the specified name. Names are compared using ordinal comparison. If there are multiple entries in the archive with the specified name, the first one found will be returned.

Namespace:  Microsoft.TeamFoundation.Server.Core
Assembly:  Microsoft.TeamFoundation.Server.Core (in Microsoft.TeamFoundation.Server.Core.dll)

Syntax

'Declaration
Public Function GetEntry ( _
    entryName As String _
) As ZipArchiveEntry
public ZipArchiveEntry GetEntry(
    string entryName
)
public:
ZipArchiveEntry^ GetEntry(
    String^ entryName
)
member GetEntry : 
        entryName:string -> ZipArchiveEntry
public function GetEntry(
    entryName : String
) : ZipArchiveEntry

Parameters

  • entryName
    Type: System.String

    A path relative to the root of the archive, identifying the desired entry.

Return Value

Type: Microsoft.TeamFoundation.Server.Core.ZipArchiveEntry
A wrapper for the file entry in the archive. If no entry in the archive exists with the specified name, null will be returned.

Exceptions

Exception Condition
ArgumentException

entryName is a zero-length string.

ArgumentNullException

entryName is null.

NotSupportedException

The ZipArchive does not support reading.

ObjectDisposedException

The ZipArchive has already been closed.

InvalidDataException

The Zip archive is corrupt and the entries cannot be retrieved.

.NET Framework Security

See Also

Reference

ZipArchive Class

Microsoft.TeamFoundation.Server.Core Namespace