Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
SharpZipLib
关于内部 gzip 实现的评论和其他帖子,它们不相同!GZip 不会创建归档所需的标头; 它仅适用于“压缩”一个文件或流。
正确的 zip 存档包含一个标头,其中列出了所有压缩文件以及它们在压缩数据中的位置,因此您需要一些可以制作标头的东西。 这意味着 SharpZipLib,它是众多商业版本之一,或者使用带有 .NET 绑定的外部版本,例如 7zip。
偶然有人想说:“但是我一直在 Linux 中看到
.gz
文件!” - 它们只是单个文件,.tar.gz
也不例外 - tar 是存档文件。.gz
是压缩的存档。SharpZipLib
Regarding the comments and other posts about the internal gzip implementation, they are not the same! GZip does not create the header required for archiving; it is only useful for "zipping" one file or stream.
Proper zip archives contain a header that list all compressed files and where in the compressed data they come and therefore you need something that makes a header. That means SharpZipLib, one of the many commercial versions or using something external with .NET bindings like 7zip.
Just on the offchance somebody wants to say this: "But I see
.gz
files in Linux all the time!" - they're just single files and.tar.gz
is no exception - tar is the archive file. The.gz
is that archive compressed.情侣评论。
DotNetZip 是一个很好的第 3 方选项。 免费、开源、积极维护、使用简单、小而良好的功能集。 它作为单个程序集提供 - 它是完全托管的代码。 适用于 Compact Framework 以及常规 .NET Framework。 先决条件是.NET 2.0。
DotNetZip 还包括一个 ZLIB 库,其中包含 {Zlib,GZip,Deflate}Stream 等类。 它们与 .NET 中内置的类相当,但它们包含设置压缩级别的功能,并且在更高级别上,它们比内置类压缩得更有效。 ZlibStream 进行 RFC 1950 压缩。
DotNetZip 支持 ZIP64、密码、AES 加密、流、SFX 和 Unicode。 每个使用它的人都说它比 SharpZipLib 使用起来简单得多。 有一个很好的帮助文件 (.chm) 和大量代码示例。
Couple comments.
DotNetZip is a good 3rd party option. Free, open source, actively maintained, simple to use, small, good feature set. It is shipped as a single assembly - it is fully managed code. Works on Compact Framework as well as on the regular .NET Framework. The pre-req is .NET 2.0.
DotNetZip also includes a ZLIB library, with classes like {Zlib,GZip,Deflate}Stream. They are comparable to those built-in to .NET, but they include the ability to set Compression Levels, and at higher levels they compress much more effectively than the built-in classes. The ZlibStream does RFC 1950 compression.
DotNetZip does ZIP64, passwords, AES encryption, streams, SFX, and Unicode. Everyone who uses it says it is much simpler to use than SharpZipLib. There's a good help file (.chm) and lots of code examples.
DotNet Zip 库 (Ionic.Zip.dll) 非常易于使用。 我觉得它比 SharpZip 更容易实现。
http://www.codeplex.com/DotNetZip
The DotNet Zip Library (Ionic.Zip.dll) is very easy to use. I feel that it's easier to implement than SharpZip.
http://www.codeplex.com/DotNetZip
尝试查看 7-zip。 它是开源的,也是我最喜欢的 zip 程序。 非常混乱。 还利用了多核的优势。
.NET SDK 可在此处获取。
Try checking out 7-zip. It's open source and my fav zip program. very kewl. takes advantage of multi cores also.
The .NET SDK is available here.
**** 但是 .NET 已经支持开源 zip....****
http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx
这与 GZIP 库兼容。 我用它来压缩 C# 数据并在 C++ 应用程序中通过网络解压缩。 工作正常。
托尼
**** But guys .NET Already supports open source zip....****
http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx
This is compatible with the GZIP libraries. I used this to compress c# data and decompress across the network in a C++ application. Works fine.
Tony