简体   繁体   English

如何在.NET 3.5中使用DotNetZip提取zip文件?

[英]How can I extract a zip file with DotNetZip in .NET 3.5?

I have a C# project in visual studio and I want to change target framework from .NET Framework 4.6 to .NET Framework 3.5 . 我在Visual Studio中有一个C#项目,我想将目标框架从.NET Framework 4.6更改为.NET Framework 3.5 In the past I used this code to exctract zip file: 过去,我使用以下代码提取zip文件:

ZipFile.ExtractToDirectory(zipPath, extractPath);

But now I can not use ZipFile class. 但是现在我不能使用ZipFile类。 So I added DotNetZip library to my project but I don't know How to use it. 所以我将DotNetZip库添加到我的项目中,但是我不知道如何使用它。

As Steve said in comments I used this link . 正如Steve在评论中所说,我使用了此链接

using (ZipFile zip = ZipFile.Read(zipPath))
{

    zip.ExtractAll(mainPath);

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM