Zip文件夹在C# [英] Zip folder in C#
问题描述
如何在C#中压缩文件夹的示例(简单代码)?
更新: p>
我看不到命名空间 ICSharpCode
。我下载了 ICSharpCode.SharpZipLib.dll
,但我不知道在哪里复制该DLL文件。我需要做什么来看这个命名空间?
并且你有MSDN示例的压缩文件夹的链接,因为我阅读所有MSDN,但我找不到
好的,但我需要下一个信息。
我在哪里应该复制 ICSharpCode.SharpZipLib.dll
以在Visual Studio中查看该命名空间?
在 DotNetZip 帮助文件中, http://dotnetzip.codeplex.com/releases/
using(ZipFile zip = new ZipFile())
{
zip.UseUnicodeAsNecessary = true; // utf-8
zip.AddDirectory(@MyDocuments\ProjectX);
zip.Comment =此zip创建于+ System.DateTime.Now.ToString(G);
zip.Save(pathToSaveZipFile);
}
What is an example (simple code) of how to zip a folder in C#?
Update:
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?
And do you have link for that MSDN example for compress folder, because I read all MSDN but I couldn't find anything.
OK, but I need next information.
Where should I copy ICSharpCode.SharpZipLib.dll
to see that namespace in Visual Studio?
From the DotNetZip help file, http://dotnetzip.codeplex.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);
}
这篇关于Zip文件夹在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!