. NET in the 7zip--sharpcompress

Source: Internet
Author: User

Although Microsoft has integrated zip decompression support in. NET 4.5, it is still weak. If we want to let the program like 7zip support Universal decompression, sharpcompress can help you achieve this goal, it is a C # write compression/decompression tool, although not yet able to do like 7Zip so NB, when the supported format is also quite a lot, the following is the current support situation:

Archive Format

Compression Format (s)

Compress/decompress

Archive API

Reader API

Writer API

Rar

Rar

Decompress (1)

Rararchive

Rarreader

N/A

Zip (2)

None, DEFLATE, BZip2, Lzma/lzma2, PPMd

Both

Ziparchive

Zipreader

Zipwriter

Tar

None, BZIP2, GZip

Both

Tararchive

Tarreader

Tarwriter (3)

GZip (Single file)

Gzip

Both

Gziparchive

Gzipreader

Gzipwriter

7Zip (4)

LZMA, LZMA2, BZip2, PPMd, BCJ, BCJ2

Decompress

Sevenziparchive

N/A

N/A

(1) SOLID Rars is only supported in the Rarreader API.
(2) ZIP format supports pkware and Winzipaes encryption. However, encrypted LZMA is not supported.
(3) The Tar format requires a file size in the header. If no size is specified to the Tarwriter and the stream isn't seekable, then an exception would be thrown.
(4) The 7ZIP format doesn ' t allow to reading as a forward-only stream so 7Zip are only supported through the Archive API

And this library is a portable,. net/mono/silverlight/wp7 and other frameworks can be used, but also what, hurriedly installed it:

Pm> Install-package sharpcompress

And it also provides some examples on NuGet:

Pm> Install-package p3-sharpcompress

If you want to know more about it, you can refer to its Project homepage:

    • codeplex:https://sharpcompress.codeplex.com/
    • Github:https://github.com/adamhathcock/sharpcompress

. NET in the 7zip--sharpcompress

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.