日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

C# .NET 使用第三方类库DotNetZip解压/压缩Zip文件

發(fā)布時(shí)間:2025/7/25 93 豆豆
生活随笔 收集整理的這篇文章主要介紹了 C# .NET 使用第三方类库DotNetZip解压/压缩Zip文件 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
dotNetZip on CodePlex:?http://dotnetzip.codeplex.com/

詳細(xì)的可以看源代碼……總之感覺(jué)比SharpZipLib好用。而且DotNetZip支持VB,C#以及任何.NET語(yǔ)言。

加壓:(從CodePlex上偷過(guò)來(lái)的)

using (ZipFile zip = new ZipFile()){// add this map file into the "images" directory in the zip archive 把這個(gè)PNG文件添加到zip檔案的"images"目錄下zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");// add the report into a different directory in the archive 然后把PDF文件添加到zip檔案的"files"目錄下,把ReadMe.txt放到根目錄zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");zip.AddFile("ReadMe.txt");// 把zip檔案保存為MyZipFile.zipzip.Save("MyZipFile.zip");}

解壓更簡(jiǎn)單:

using (ZipFile zip = new ZipFile("MyZipFile.zip")) {zip.ExtractAll("c:\\myfolder", ExtractExistingFileAction.OverwriteSilently); }

?

這就可以了!什么問(wèn)題都木有,是不是比SharpZipLib方便多了!

?

轉(zhuǎn)載于:https://www.cnblogs.com/damsoft/p/6100320.html

總結(jié)

以上是生活随笔為你收集整理的C# .NET 使用第三方类库DotNetZip解压/压缩Zip文件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。