Windows zip api




















Privacy policy. Thank you. Microsoft makes no warranties, express or implied, with respect to the information provided here. To use the ZipFile class in a. NET Framework app, you must add a reference to the System. FileSystem assembly in your project. This example shows how to create and extract a zip archive by using the ZipFile class. It compresses the contents of a folder into a zip archive, and then extracts that content to a new folder. Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level, and optionally includes the base directory.

Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level and character encoding for entry names, and optionally includes the base directory. Extracts all the files in the specified zip archive to a directory on the file system and uses the specified character encoding for entry names.

Then it calls Compress , with CompressedBufferSize set to 0, to query for the required size of the compressed buffer. It allocates an output buffer to the CompressedBufferSize value. The application calls Compress a second time to perform the actual compression.

Finally, the application writes the compressed data to the output file. The following code snippet demonstrates file decompression using the Compression API in buffer mode. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. For a code example of a block mode application, see the Using the Compression API in block mode section.

Buffer and block mode applications have the option to specify a custom memory allocation routine when they call CreateCompressor and CreateDecompressor. The application can then set the block size for the compressor using SetCompressorInformation.

See the Using the Compression API in block mode section for an example of a simple customized allocation routine. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? In this article.



0コメント

  • 1000 / 1000