利用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.
ZipLib组件与.net自带的Copression比较,在压缩方面更胜一筹,经过BZip2压缩要小很多,亲手测试,不信你也可以试一试。而且这个功能更加强大。下面就是个人做的一个小例子,具体的应用程序源码: /Files/yank/Compress.rar。
1using System;
2using System.Data;
3using System.IO;
4using ICSharpCode.SharpZipLib.Zip.Compression;
5using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
6using ICSharpCode.SharpZipLib.GZip;
7
8/**//// <summary>
9/// Summary description for ICSharp
10/// </summary>
11public class ICSharp
12{
13 public ICSharp()
14
2using System.Data;
3using System.IO;
4using ICSharpCode.SharpZipLib.Zip.Compression;
5using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
6using ICSharpCode.SharpZipLib.GZip;
7
8/**//// <summary>
9/// Summary description for ICSharp
10/// </summary>
11public class ICSharp
12{
13 public ICSharp()
14
上一个:winform打包发布安装包详解
下一个:c# 引用类型和值类型区别