C# system.io.compression zip file




















Thank you. Microsoft makes no warranties, express or implied, with respect to the information provided here. The methods for manipulating zip archives and their file entries are spread across three classes: ZipFile , ZipArchive , and ZipArchiveEntry.

When you create a new entry, the file is compressed and added to the zip package. The CreateEntry method enables you to specify a directory hierarchy when adding the entry. You include the relative path of the new entry within the zip package. If you reference the System.

NET Core 2. These extension methods enable you to compress and decompress the contents of the entry to a file. The System. FileSystem assembly is not available for Windows 8. In Windows 8. The following example shows how to open a zip archive and iterate through the collection of entries. The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names.

This method creates the specified directory and all subdirectories, if necessary. If entryNameEncoding is set to a value other than null , entry names are decoded according to the following rules:. If entryNameEncoding is set to null , entry names are decoded according to the following rules:. The encoding to use when reading entry names in this ZipArchive. A ZipArchiveEntry has the same name as an already extracted entry from the same archive. Skip to main content. This browser is no longer supported.

Download Microsoft Edge More info. Contents Exit focus mode. Zip File. Please rate your experience Yes No. The following example shows how to compress and decompress a directory of files by using the GZipStream class:.

Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Is this page helpful? Please rate your experience Yes No.

Any additional feedback? Namespace: System. Compression Assembly: System. Provides static methods for creating, extracting, and opening zip archives. Note To use the ZipFile class in a. In this article.

CreateFromDirectory String, String. Creates a zip archive that contains the files and directories from the specified directory. ExtractToDirectory String, String.



noughdiletcie1987's Ownd

0コメント

  • 1000 / 1000