ZipArchive.CreateEntry Method (String, CompressionLevel)

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 occurs in the archive, a second entry will be created that has the same name.

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

Syntax

'Declaration
Public Function CreateEntry ( _
    entryName As String, _
    compressionLevel As CompressionLevel _
) As ZipArchiveEntry
public ZipArchiveEntry CreateEntry(
    string entryName,
    CompressionLevel compressionLevel
)
public:
ZipArchiveEntry^ CreateEntry(
    String^ entryName, 
    CompressionLevel compressionLevel
)
member CreateEntry : 
        entryName:string * 
        compressionLevel:CompressionLevel -> ZipArchiveEntry
public function CreateEntry(
    entryName : String, 
    compressionLevel : CompressionLevel
) : ZipArchiveEntry

Parameters

  • entryName
    Type: System.String

    A path relative to the root of the archive that indicates the name of the entry to be created.

Return Value

Type: Microsoft.TeamFoundation.Framework.Server.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

See Also

Reference

ZipArchive Class

CreateEntry Overload

Microsoft.TeamFoundation.Framework.Server Namespace