ZipArchive.CreateEntry Method (String)
Creates an empty entry in the Zip archive with the specified entry name. There are no restrictions on the names of entries. The last write time of the entry is set to the current time. If an entry with the specified name already exists in the archive, a second entry will be created that has an identical name. Since no CompressionLevel is specified, the default provided by the implementation of the underlying compression algorithm will be used; the ZipArchive will not impose its own default. (Currently, the underlying compression algorithm is provided by the System.IO.Compression.DeflateStream class.)
Namespace: Microsoft.TeamFoundation.Server.Core
Assembly: Microsoft.TeamFoundation.Server.Core (in Microsoft.TeamFoundation.Server.Core.dll)
Syntax
'Declaration
Public Function CreateEntry ( _
entryName As String _
) As ZipArchiveEntry
public ZipArchiveEntry CreateEntry(
string entryName
)
public:
ZipArchiveEntry^ CreateEntry(
String^ entryName
)
member CreateEntry :
entryName:string -> ZipArchiveEntry
public function CreateEntry(
entryName : String
) : ZipArchiveEntry
Parameters
entryName
Type: System.StringA path relative to the root of the archive, indicating the name of the entry to be created.
Return Value
Type: Microsoft.TeamFoundation.Server.Core.ZipArchiveEntry
A wrapper for the newly created file entry in the archive.
Exceptions
Exception | Condition |
---|---|
ArgumentException | entryName is a zero-length string. |
ArgumentNullException | entryName is null. |
NotSupportedException | The ZipArchive does not support writing. |
ObjectDisposedException | The ZipArchive has already been closed. |
.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.