Ionic Zip Library v1.9.1.6
AddEntry Method (entryName, content, encoding)
Adds a named entry into the zip archive, taking content for the entry
from a string, and using the specified text encoding.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ |
![](collapse_all.gif)
- 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.
![](collapse_all.gif)
The ZipEntry added.
![](collapse_all.gif)
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).