问题描述
什么是一个例子,如何在C#压缩的文件夹(简单code)?
What is an example (simple code) of how to zip a folder in C#?
更新:
我不明白的命名空间 ICSharp code
。我下载 ICSharp code.SharpZipLib.dll
,但我不知道在哪里可以复制该DLL文件。什么我需要做的,看看这个命名空间?
I do not see namespace ICSharpCode
. I downloaded ICSharpCode.SharpZipLib.dll
but I do not know where to copy that DLL file. What do I need to do to see this namespace?
和你有链接为MSDN例如为COM preSS文件夹,因为我读了所有MSDN但我找不到任何东西。
And do you have link for that MSDN example for compress folder, because I read all MSDN but I couldn't find anything.
OK,但我需要下一个信息。
OK, but I need next information.
我应该在哪里复制 ICSharp code.SharpZipLib.dll
来看看在Visual Studio中该命名空间?
Where should I copy ICSharpCode.SharpZipLib.dll
to see that namespace in Visual Studio?
推荐答案
从的帮助文件, HTTP://dotnetzip.$c$cplex.com/releases/
using (ZipFile zip = new ZipFile())
{
zip.UseUnicodeAsNecessary= true; // utf-8
zip.AddDirectory(@"MyDocuments\ProjectX");
zip.Comment = "This zip was created at " + System.DateTime.Now.ToString("G") ;
zip.Save(pathToSaveZipFile);
}
这篇关于在C#邮编文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!