Share via


ZipArchive.CreateEntryFromFile Method

Include Protected Members
Include Inherited Members

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method CreateEntryFromFile(String, String) Adds a file from the file system to the archive under the specified entry name. The new entry in the archive will contain the contents of the file. The last write time of the archive entry is set to the last write time of the file on the file system. If an entry with the specified name already occurs in the archive, a second entry will be created that has the same name. If the specified source file has an invalid last modified time, the first datetime representable in the Zip timestamp format (midnight on January 1, 1980) will be used. If an entry with the specified name already occurs in the archive, a second entry will be created that has the same name.Since no CompressionLevel is specified, the default provided by the implementation of the underlying compression algorithm will be used; the ZipArchive will not impose its own default.Currently, the underlying compression algorithm is provided by the System.IO.Compression.DeflateStreamclass.
Public method CreateEntryFromFile(String, String, CompressionLevel) Adds a file from the file system to the archive under the specified entry name. The new entry in the archive will contain the contents of the file. The last write time of the archive entry is set to the last write time of the file on the file system. If an entry with the specified name already occurs in the archive, a second entry will be created that has the same name. If the specified source file has an invalid last modified time, the first datetime representable in the Zip timestamp format (midnight on January 1, 1980) will be used.

Top

See Also

Reference

ZipArchive Class

Microsoft.TeamFoundation.Framework.Server Namespace