1. 大家可以到http://www.icsharpcode.net/opensource/sharpziplib/ 下载SharpZiplib的最新版本,支持Zip, GZip, BZip2 和Tar格式,本作者的项目代码如下

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.SharpZipLib.Zip;//来自项目icsharpcode-SharpZipLib-e012155生成的ICSharpCode.SharpZipLib.dll

namespace TestZIP
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
try
{
using (FolderBrowserDialog dlg = new FolderBrowserDialog())
{
//dlg.CheckFileExists = true;
//dlg.CheckPathExists = true;
if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
{
if (dlg.SelectedPath != null)
{
FastZip fz = new FastZip();
fz.CreateZip("123.zip", dlg.SelectedPath, true, "");
MessageBox.Show("压缩完成!", "信息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
//throw;
}
}

private void button2_Click(object sender, EventArgs e)
{
try
{
using (OpenFileDialog dlg = new OpenFileDialog())
{
//dlg.CheckFileExists = true;
//dlg.CheckPathExists = true;
if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
{
if (dlg.FileName != null)
{
FastZip fz = new FastZip();
fz.ExtractZip(dlg.FileName, Application.StartupPath + "\\新建文件夹", "");
//fz.CreateZip("123.zip", dlg.SelectedPath, true, "");
MessageBox.Show("解压完成!", "信息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
//throw;
}
}
}
}

项目

zip压缩解压缩 项目icsharpcode-SharpZipLib-e012155的更多相关文章

  1. Qt之QuaZIP(zip压缩/解压缩)

    简述 QuaZIP是使用Qt/C++对ZLIB进行简单封装的用于压缩及解压缩ZIP的开源库.适用于多种平台,利用它可以很方便的将单个或多个文件打包为zip文件,且打包后的zip文件可以通过其它工具打开 ...

  2. Qt之zip压缩/解压缩(QuaZIP)

    摘要: 简述 QuaZIP是使用Qt/C++对ZLIB进行简单封装的用于压缩及解压缩ZIP的开源库.适用于多种平台,利用它可以很方便的将单个或多个文件打包为zip文件,且打包后的zip文件可以通过其它 ...

  3. AntZipUtils【基于Ant的Zip压缩解压缩工具类】

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 Android 压缩解压zip文件一般分为两种方式: 基于JDK的Zip压缩工具类 该版本存在问题:压缩时如果目录或文件名含有中文, ...

  4. zip:命令行下zip压缩/解压缩

    在Ubuntu 18.04下验证,造冰箱的大熊猫@cnblogs 2019/6/6 序号 功能 命令行输入的命令 1 压缩单个文件 zip package.zip file 2 压缩多个文件 zip ...

  5. Zip压缩/解压缩(文件夹)

    #PS2.0压缩为.zip文件: $zip = "D:\audit_log\test.zip"New-Item $zip -ItemType file$shellApplicati ...

  6. centos8下gz,bz2,zip压缩解压缩

    for gz 1.制作压缩包 [root@192 mnt]# tar czf mydir.tar.gz mydir1/ 2.解压gz 压缩包 [root@192 mnt]# tar xvf mydir ...

  7. 基于ICSharpCode.SharpZipLib.Zip的压缩解压缩

    原文:基于ICSharpCode.SharpZipLib.Zip的压缩解压缩 今天记压缩解压缩的使用,是基于开源项目ICSharpCode.SharpZipLib.Zip的使用. 一.压缩: /// ...

  8. C#调用 ICSharpCode.SharpZipLib.Zip 实现解压缩功能公用类

    最近想用个解压缩功能 从网上找了找 加自己修改,个人感觉还是比较好用的,直接上代码如下 using System; using System.Linq; using System.IO; using ...

  9. 利用ICSharpCode.SharpZipLib.Zip进行文件压缩

    官网http://www.icsharpcode.net/ 支持文件和字符压缩. 创建全新的压缩包 第一步,创建压缩包 using ICSharpCode.SharpZipLib.Zip; ZipOu ...

随机推荐

  1. socket的NIO操作

    一.前言 Java中直接使用socket进行通信的场景应该不是很多,在公司的一个项目中有这种需求,所以根据自己的理解和相关资料的参考,基于NIO 实现了一组工具类库,具体的协议还未定义,后续再整理 二 ...

  2. 转载---SQL Server XML基础学习之<5>--XQuery(query)

    本章写一些SQL Server XML的一些XQuery基础语法,主要讲的query查询语法 T-SQL 支持用于查询 XML 数据类型的 XQuery 语言的子集. XQuery 基于现有的 XPa ...

  3. Mysql下在某一列后即表的某一位置添加新列的sql语句

    Mysql简介 MySQL是一个开放源码的小型关联式数据库管理系统,开发者为瑞典MySQL AB公司.MySQL被广泛地应用在Internet上的中小型网站中.由于其体积小.速度快.总体拥有成本低,尤 ...

  4. entityframework多条件查询类

    entityframework多条件查询类 var dataaccess = new BaseAccess(); int totalCount = 0; var paramS = new OrderM ...

  5. javascript创建对象和属性的几种方式

    一句话,javascript里面的对象,即是函数.方法. (一)第一种: a.声明对象:var JHSoft = JHSoft || {}; 或者 var JHSoft=new Object(); b ...

  6. StringToInt

    public class Stringtoint {    public static void stringtoint(String s){        //判断字符串是否为null和是否为空   ...

  7. 升级Capitan 10.11以后CocoaPod 无效解决办法

    今天发现升级10.11的系统以后执行 pod install 的时候报错 zsh: command not found: pod 解决方法如下: 1.检查gem 的数据源 gem sources -l ...

  8. 数位DP入门Ural1057

    CF一战让我觉得很疲倦,所以今天感觉很慢. 昨天解D题时候,因为太累,根本连题目都没看,今天看了之后感觉不会做,听闻是数位DP问题. 有某神说过,DP的功力建立在刷过的题上,我真的毫无功力可言. 介绍 ...

  9. ubuntu nginx 伪静态 设置

    简单的静态设置 1  vim nginx.conf // 修改nginx配置文件 server { .... root /usr/local/nginx/html; #nginx网站根目录 #下面这个 ...

  10. linux/win7下安装websphere application server

    说明: 1.参考网址:http://www.ibm.com/developerworks/cn/aix/library/au-wasonlinux/ 2.在ibm官网上下载websphere appl ...