AddEntry Method (entryName, content, encoding)

DotNetZip

Ionic Zip Library v1.9.1.6 AddEntry Method (entryName, content, encoding)
ReferenceIonic.ZipZipFileAddEntry(String, String, Encoding)
Adds a named entry into the zip archive, taking content for the entry from a string, and using the specified text encoding.
Declaration Syntax
C# Visual Basic Visual C++
public ZipEntry AddEntry(
	string entryName,
	string content,
	Encoding encoding
)
Public Function AddEntry ( _
	entryName As String, _
	content As String, _
	encoding As Encoding _
) As ZipEntry
public:
ZipEntry^ AddEntry(
	String^ entryName, 
	String^ content, 
	Encoding^ encoding
)
Parameters
entryName (String)
The name, including any path, to use within the archive for the entry.
content (String)
The content of the file, should it be extracted from the zip.
encoding (Encoding)
The text encoding to use when encoding the string. Be aware: This is distinct from the text encoding used to encode the fileName, as specified in ProvisionalAlternateEncoding.
Return Value
The ZipEntry added.
Remarks

Calling this method creates an entry using the given fileName and directory path within the archive. There is no need for a file by the given name to exist in the filesystem; the name is used within the zip archive only.

The content for the entry, a string value, is encoded using the given text encoding. A BOM (byte-order-mark) is emitted into the file, if the Encoding parameter is set for that.

Most Encoding classes support a constructor that accepts a boolean, indicating whether to emit a BOM or not. For example see UTF8Encoding(Boolean).

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)