在归档文件的C#名单 [英] C# List of files in an archive

查看:105
本文介绍了在归档文件的C#名单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个FileFinder类,在这里你可以做这样的搜索:

I am creating a FileFinder class, where you can do a search like this:

    var fileFinder = new FileFinder(
                         new string[]
                             {
                                  "C:\\MyFolder1",
                                  "C:\\MyFolder2" 
                             }, 
                         new string[]
                             {
                                  "*.txt",
                                  "*.doc"
                             } );
    fileFinder.FileFound += new EventHandler<FileFinderEventArgs>(FileFinder_FileFound);
    DoSearch();

如果我执行的代码, FileFinder_FileFound 会被称为每次 * TXT * DOC 文件中的发现C: \\MyFolder1 及其子文件夹,或 C:\\MyFolder2 及其子

If I executed that code, FileFinder_FileFound would be called every time a *.txt or *.doc file was found in C:\\MyFolder1 and its subfolders, or C:\\MyFolder2 and its subfolders.

SOT类看起来通过子文件夹,但我也希望它通过它来跨越任何zip文件看,就好像它们是文件夹。我怎样才能做到这一点?这将是可取的,没有临时文件被创建...

Sot the class looks through subfolders, but I also want it to look through any zip files it comes across, as if they were folders. How can I do this? It would be preferable that no temporary files be created...

修改忘记提到这不是一个个人项目; ,其对我的工作与我公司商业应用程序

EDIT Forgot to mention this is not a personal project; its for a commercial application I'm working on with my company.

推荐答案

结帐的 System.IO.Packaging程序命名空间在.NET 3.5和更高的使用。您会在这里找到一些很好的答案

Checkout System.IO.Packaging Namespace available in .NET 3.5 and higher. You'll find some good answers here

这篇关于在归档文件的C#名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆