您的位置:首页 > 编程语言

压缩自动压缩(压缩格式*.zip)代码

2008-10-31 17:14 190 查看
要实现自动压缩,需要ICSharpCode.SharpZipLib.dll 文件,连接地址:http://files.cnblogs.com/jiangguanghe/ICSharpCode.SharpZipLib.rar

然后就是操作这个DLL文件

先要导入空间:

Code

/// <summary>

/// Creates a Zip File.

/// </summary>

/// <param name="files">The Files to include in the Zip File.</param>

/// <param name="baseDir">The Base directory of the Files (it will be removed from their full path).</param>

/// <param name="destination">The destination Zip File.</param>

/// <param name="level">The compression level (0 min - 9 max).</param>

public static void Create(string[] files, string baseDir, string destination, int level)

{

Create(files, baseDir, File.Create(destination), level);

}

呵呵,一个压缩的功能就这样实现了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: