ZipEntryOptions Class

Options of a new entry of a ZipArchive. The properties that are null use the value of the ZipCompressionOptions of the archive.

public sealed class ZipEntryOptions

Constructors

NameDescription
ZipEntryOptions()

ZipEntryOptions()

public ZipEntryOptions()

No documentation is available.

Properties

NameDescription
AttributesGets or sets the MS-DOS attributes of the entry (the low 16 bits of the external attributes), or null for none, or FileAttributes.Directory for a directory.
CommentGets or sets the comment of the entry, or null. It is written as UTF-8 when it is not ASCII.
CompressionLevelGets or sets the compression level of the entry, or null for ZipCompressionOptions.CompressionLevel.
CompressionMethodGets or sets the compression method of the entry, or null for ZipCompressionOptions.CompressionMethod.
EncryptionGets or sets the encryption of the entry, or null for ZipCompressionOptions.Encryption. It applies only when the entry has a password; ZipEncryption.None writes the entry without encryption.
LastWriteTimeGets or sets the last time the entry was modified, or null for the current time. It is written as an MS-DOS time, in the local time zone and with a 2-second precision (as ZipArchive does), and as a Unix time in UTC, with a 1-second precision, in the extended timestamp extra field (0x5455).
PasswordGets or sets the password of the entry, or null for ZipCompressionOptions.Password. An empty string writes the entry without encryption, even when the archive has a password.
UnixFileModeGets or sets the Unix permissions of the entry, or null. When it is set, the entry is marked as created on Unix, and the high 16 bits of its external attributes are its mode: the file type and the permissions.

Gets or sets the MS-DOS attributes of the entry (the low 16 bits of the external attributes), or null for none, or FileAttributes.Directory for a directory.

public FileAttributes? Attributes { get; set; }

Property value

FileAttributes?

Gets or sets the comment of the entry, or null. It is written as UTF-8 when it is not ASCII.

public string? Comment { get; set; }

Property value

string?

CompressionLevel

ZipEntryOptions.cs

Gets or sets the compression level of the entry, or null for ZipCompressionOptions.CompressionLevel.

public CompressionLevel? CompressionLevel { get; set; }

Property value

CompressionLevel?

CompressionMethod

ZipEntryOptions.cs

Gets or sets the compression method of the entry, or null for ZipCompressionOptions.CompressionMethod.

public ZipCompressionMethod? CompressionMethod { get; set; }

Property value

ZipCompressionMethod?

Gets or sets the encryption of the entry, or null for ZipCompressionOptions.Encryption. It applies only when the entry has a password; ZipEncryption.None writes the entry without encryption.

public ZipEncryption? Encryption { get; set; }

Property value

ZipEncryption?

LastWriteTime

ZipEntryOptions.cs

Gets or sets the last time the entry was modified, or null for the current time. It is written as an MS-DOS time, in the local time zone and with a 2-second precision (as ZipArchive does), and as a Unix time in UTC, with a 1-second precision, in the extended timestamp extra field (0x5455).

public DateTimeOffset? LastWriteTime { get; set; }

Property value

DateTimeOffset?

Gets or sets the password of the entry, or null for ZipCompressionOptions.Password. An empty string writes the entry without encryption, even when the archive has a password.

public string? Password { get; set; }

Property value

string?

UnixFileMode

ZipEntryOptions.cs

Gets or sets the Unix permissions of the entry, or null. When it is set, the entry is marked as created on Unix, and the high 16 bits of its external attributes are its mode: the file type and the permissions.

public UnixFileMode? UnixFileMode { get; set; }

Property value

UnixFileMode?