ZipFile
. The ZipFile
instance is written to storage, typically a zip file in a filesystem, only when the caller calls Save
. In the typical case, the Save operation writes the zip content to a temporary file, and then renames the temporary file to the desired name. If necessary, this method will delete a pre-existing file before the rename.
The ZipFile.Name property is specified either explicitly, or implicitly using one of the parameterized ZipFile constructors. For COM Automation clients, the Name
property must be set explicitly, because COM Automation clients cannot call parameterized constructors.
When using a filesystem file for the Zip output, it is possible to call Save
multiple times on the ZipFile
instance. With each call the zip content is re-written to the same output file.
Data for entries that have been added to the ZipFile
instance is written to the output when the Save
method is called. This means that the input streams for those entries must be available at the time the application calls Save
. If, for example, the application adds entries with AddEntry
using a dynamically-allocated MemoryStream
, the memory stream must not have been disposed before the call to Save
. See the
public Save ( ) : void | ||
Результат | void |