这里就不说压缩/解压了。网上教程太多。

主要说一下,解压时,如何过滤某些文件/文件夹

参考地址:https://github.com/icsharpcode/SharpZipLib/wiki/FastZip

主要内容:

解压时:过滤文件

以下表达式包含所有以“.dat”结尾的名称,但“dummy.dat”除外

// To conditionally extract files in FastZip, use the fileFilter and directoryFilter arguments.
// The filter is a list of regex values separated with semi-colon. An entry starting with - is an exclusion.
// See the NameFilter class for more details.
// The following expression includes all name ending in '.dat' with the exception of 'dummy.dat'
string fileFilter = @"+\.dat$;-^dummy\.dat$";
string directoryFilter = null;
bool restoreDateTime = true; // Will prompt to overwrite if target filenames already exist
fastZip.ExtractZip(zipFileName, targetDir, FastZip.Overwrite.Prompt, OverwritePrompt,
fileFilter, directoryFilter, restoreDateTime);

解压时:过滤文件夹

以下是解压时,过滤Download和Upload文件夹

(new FastZip()).ExtractZip(downloadFile, UnPath, FastZip.Overwrite.Always, null, "", @"-Download;-Update", true);

SharpZipLib 文件/文件夹 过滤的更多相关文章

  1. JAVA之旅(二十八)——File概述,创建,删除,判断文件存在,创建文件夹,判断是否为文件/文件夹,获取信息,文件列表,文件过滤

    JAVA之旅(二十八)--File概述,创建,删除,判断文件存在,创建文件夹,判断是否为文件/文件夹,获取信息,文件列表,文件过滤 我们可以继续了,今天说下File 一.File概述 文件的操作是非常 ...

  2. Linux关于文件,文件夹操作命令

    文件 文件夹 相关操作命令 查看文件 cd 切换目录位置 ls 目录    查看指定目录所有文件  --缺省当前目录 ls -l 目录 查看指定目录所有文件的详细信息 --同 ll 命令 ls -a ...

  3. 使用SharpZipLib实现文件压缩、解压

    接口 public interface IUnZip { /// <summary> /// 功能:解压zip格式的文件. /// </summary> /// <par ...

  4. NSFileManager计算文件/文件夹大小

    在一些软件中,一般都会给用户展现当前APP的内存,同时用户可以根据自己的需要来清除缓存的内容.一般而言,文件夹是没有大小这个属性的,所以需要遍历文件夹的内容来计算文件夹的大小,下面用NSFileMan ...

  5. linux下SVN忽略文件/文件夹的方法

    linux下SVN忽略文件/文件夹的方法 假设想忽略文件temp 1. cd到temp所在的目录下: 2. svn propedit svn:ignore . 注意:请别漏掉最后的点(.表示当前目录) ...

  6. 在C#中利用SharpZipLib进行文件的压缩和解压缩收藏

    我在做项目的时候需要将文件进行压缩和解压缩,于是就从http://www.icsharpcode.net(http://www.icsharpcode.net/OpenSource/SharpZipL ...

  7. 【SVN】删除文件/文件夹 svn: E205007: Could not use external editor to fetch log message

    在SVN Server上删除文件/文件夹 svn delete 文件的URL -m "评论" 一定要加 -m 不然会报错 svn: E205007: Could not use e ...

  8. Linux中RM快速删除大量文件/文件夹方法

    昨天遇到一个问题,在Linux中有一个文件夹里面含有大量的Cache文件(夹),数量级可能在百万级别,使用rm -rf ./* 删除时间慢到不可接受.Google了一下,查到了一种方法,试用了下确实比 ...

  9. linux压缩文件(夹) zip uzip命令的用法

    压缩文件(夹) # 压缩列举的文件,格式如下: zip 压缩包名称 文件1 文件2 文件3 ... # 压缩test.txt, a.out文件,并取名为abc.zip $ zip abc.zip te ...

随机推荐

  1. 基于SSL实现MySQL的加密主从复制

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u012974916/article/details/53316758 大家都知道MySQL的主从复制 ...

  2. html中插入css的4种方法

    #1:链入外部样式表 <head> <link href="mystyle.css" rel="stylesheet" type=" ...

  3. Ubuntu命令行操作

    一.文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件) ls -a 列出当前目录文件(包括隐含文件) ls -l 列出当前目录下文件的详细信息 cd .. 回当前目录的上一级目录 cd - 回 ...

  4. [js测试]JavaScript Web Quiz By davidshariff

    Question1 var foo = function foo() { console.log(foo === foo); }; foo(); 输出是"true",因为foo就指 ...

  5. 转:KVM 虚拟机的克隆

    KVM 虚拟机的克隆 首先把需要克隆的源虚拟机先关闭,然后使用以下命令来进行克隆,注意我这里使用的是相对路径.   virsh shutdown VM02 virt-clone -o VM02 -n ...

  6. 将第三方jar包安装到本地maven仓库

    这里有2个案例,需要手动发出Maven命令包括一个 jar 到 Maven 的本地资源库. 要使用的 jar 不存在于 Maven 的中心储存库中. 您创建了一个自定义的 jar ,而另一个 Mave ...

  7. springColud父工程依赖配置

    <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot ...

  8. Reverse array

    数组颠倒算法 #include <iostream> #include <iterator> using namespace std; void reverse(int* A, ...

  9. GIT上传下载报错:[You do not have permission to pull from the repository]的解决方案!

    第一步:打开我的电脑 第二步:选择此电脑,右击弹出框点击属性进入控制面板 第三步:进入控制面板 第四步:搜索管理凭据 第五步:编点击右侧按钮,进行编辑用户名和密码的操作添加凭据 git:https:/ ...

  10. python 网络编程:socket(二)

    上节地址:Python网络编程:socket 一.send和sendall区别 send,sendall         ret = send('safagsgdsegsdgew') #send 发送 ...