压缩整个文件夹-不仅是文件 [英] Zipping the whole folder - not only the files

查看:151
本文介绍了压缩整个文件夹-不仅是文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我在网上搜索了一个代码,该代码不仅可以压缩指定文件夹中的文件,还可以压缩整个文件夹中的文件.我发现了很多例子,但没有一个例子可以满足我的需求.其他可能会做我无法运行的工作-例如DotNetZipFiles

有人可以帮我吗.我需要的结果与我正确单击文件夹并将其发送到压缩文件夹相同.

我很乐意在C#或VB.Net中找到解决方案

谢谢
B

Hello,

I have searched the net for a code that would zip not just the files from a specified folder but the whole folder. I found many example but non of them is doing what I need. Others that could probably do the job I am unalbe to run - example DotNetZipFiles

Could anybody help me with that please. I need the same result as I am right cliking a folder and send to a commpressed folder.

I would be happy for a solution either in C# or VB.Net

Thanks
B

推荐答案

查看此链接:

C#压缩文件和/或文件夹 [如何在ASP.NET中压缩文件夹 [ http://www.c-sharpcorner.com/UploadFile/scottlysle/CompressFolders04242007124203PM/CompressFolders.aspx [ ^ ]
Zip Utils-干净,优雅,简单,C ++/Win32 [
See this links :

C# Zip Files and/or Folders[^]
How to zip a folder in ASP.NET[^]
http://www.c-sharpcorner.com/UploadFile/scottlysle/CompressFolders04242007124203PM/CompressFolders.aspx[^]
Zip Utils - clean, elegant, simple, C++/Win32[^]


Google是您的敌人吗?这是答案之一: http://stackoverflow.com/questions/905654/zip-folder -in-c-sharp [ ^ ].

我认为您需要在.NET中使用SharpZipLib, http://www.icsharpcode.net/OpenSource/SharpZipLib/ [ ^ ].

—SA
Is Google your enemy? Here is one of the answers: http://stackoverflow.com/questions/905654/zip-folder-in-c-sharp[^].

I think all you need to do it in .NET is using SharpZipLib, http://www.icsharpcode.net/OpenSource/SharpZipLib/[^].

—SA


对不起,我无法使其正常工作.您提出的大多数解决方案我以前都可以找到和测试,但可能我做错了.我是C#的新手.

我下载了以下示例 http://geraldgibson. net/dnn/Home/CZipFileCompression/tabid/148/Default.aspx [
Sorry guys, I cant make it to work. Most of the solutios that you have proposed I was previously able to find and test but probably I am doing something wrong. I am new to C#.

I downloaded the following example http://geraldgibson.net/dnn/Home/CZipFileCompression/tabid/148/Default.aspx[^]

but when I run it it zips only one file from the specified folder. Could anybody help me with this specific exmample? Are you able to sucesfully run it and zip a whole folder?

Thanks in advance!
B


这篇关于压缩整个文件夹-不仅是文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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