是否有可能使用System.IO.Packaging.Package来压缩文件夹并添加文件/文件夹后呢? [英] Is it possible to use System.IO.Packaging.Package to zip a folder and add files/folders later to it?

查看:350
本文介绍了是否有可能使用System.IO.Packaging.Package来压缩文件夹并添加文件/文件夹后呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否我们可以使用 .NET类ZipPackage 的一个文件夹压缩到 file.zip 文件。然后,我想打开 file.zip 并添加更多的文件/文件夹进去。这可能吗?

I wonder if we can use the .net class ZipPackage to zip a folder to a file.zip file. And then, I want open file.zip and add more files/folders into it. Is it possible?

我试图用本地.NET库如果可能的话

I'm trying to use native .net library if possible

推荐答案

感谢大家!您的任何建议都对我非常有帮助的。

Thank you everyone! Any of your suggestion are very helpful to me.

由于我喜欢使用原生支持.NET库,我投资自己在ZipPackage类,并经过一段时间努力,我答案我自己的问题是

Since I prefer to use native-supported .net library, I invest myself in ZipPackage class and after a while trying, my answer to my own question is yes.

最后,我已经知道如何使用它的文件/文件夹添加到包。这里是我的修改版,这是从MSDN 样本,这使我们能够做到这一点推导

At last, I have figured out how to use it to add file/folder to a package. Here's my modified version, which was derived from the sample on MSDN, that allows us to do so.

这篇关于是否有可能使用System.IO.Packaging.Package来压缩文件夹并添加文件/文件夹后呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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