ZipArchiveEntry.Open Method
Opens the entry. If the archive that the entry belongs to was opened in Read mode, the returned stream will be readable, and it may or may not be seekable. If Create mode, the returned stream will be writeable and not seekable. If Update mode, the returned stream will be readable, writeable, seekable, and support SetLength.
Namespace: Microsoft.TeamFoundation.Server.Core
Assembly: Microsoft.TeamFoundation.Server.Core (in Microsoft.TeamFoundation.Server.Core.dll)
Syntax
'Declaration
Public Function Open As Stream
public Stream Open()
public:
Stream^ Open()
member Open : unit -> Stream
public function Open() : Stream
Return Value
Type: System.IO.Stream
A Stream that represents the contents of the entry.
Exceptions
Exception | Condition |
---|---|
IOException | The entry is already currently open for writing. -or- The entry has been deleted from the archive. -or- The archive that this entry belongs to was opened in ZipArchiveMode.Create, and this entry has already been written to once. |
InvalidDataException | The entry is missing from the archive or is corrupt and cannot be read. -or- The entry has been compressed using a compression method that is not supported. |
ObjectDisposedException | The ZipArchive that this entry belongs to has been disposed. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.