当前位置:编程学习 > C#/ASP.NET >>

利用ICSharpCode.SharpZipLib进行压缩

#ZipLib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. It is implemented as an assembly (installable in the GAC), and thus can easily be incorporated into other projects (in any .NET language).#ZipLib was ported from the GNU Classpath ZIP library for use with #Develop (http://www.icsharpcode.net/OpenSource/SD) which needed gzip/zip compression.  Later bzip2 compression and tar archiving was added due to popular demand.
官方下载:http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx
   ZipLib组件与.net自带的Copression比较,在压缩方面更胜一筹,经过BZip2压缩要小很多,亲手测试,不信你也可以试一试。而且这个功能更加强大。下面就是个人做的一个小例子,具体的应用程序源码: /Files/yank/Compress.rar。

 1\using System;
 2\using System.Data;
 3\using System.IO;
 4\using ICSharpCode.SharpZipLib.Zip.Compression;
 5\using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
 6\using ICSharpCode.SharpZipLib.GZip;
 7\
 8\/**//// <summary>
 9\/// Summary description for ICSharp
10\/// </summary>
11\public class ICSharp
12\\{
13\    public ICSharp()
14\
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,