如何解压ZIP文件在C# [英] How to extract ZIP file in C#

查看:244
本文介绍了如何解压ZIP文件在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C#解压ZIP文件?

解决方案

DotNetZip


类库和用于操作zip文件的工具集。使用VB,C#或任何.NET语言轻松创建,解压缩或更新zip文件...



DotNetZip适用于具有完整.NET Framework的PC,在使用.NET Compact Framework的移动设备上运行。在VB,C#或任何.NET语言或任何脚本环境中创建和读取zip文件。 DotNetZip支持以下场景:




  • 一个可动态创建zip文件的Silverlight应用程序。


  • 修改现有归档的WPF程序 - 重命名条目,从归档中删除条目或向归档中添加新条目
  • 创建AES加密zip归档文件

  • 一个用于解压缩或压缩邮件的SSIS脚本

  • 在PowerShell或VBScript中执行备份和归档的管理脚本。

  • 一个WCF服务,用于接收作为附件的zip文件,并动态将zip解压缩到流以进行分析

  • 一个旧式ASP(VBScript)应用程序, ZIP文件通过COM接口为DotNetZIp

  • 一个Windows Forms应用程序读取或更新ODS文件

  • 从流内容创建zip文件,



p>如果你想要的是一个更好的DeflateStream或GZipStream类来替换内置的.NET BCL,DotNetZip也有。 DotNetZip的DeflateStream和GZipStream在基于Zlib的.NET端口的独立程序集中可用。这些流支持压缩级别,并提供比内置类更好的性能。还有一个ZlibStream完成集(RFC 1950,1951,1952)...


有趣


How can I extract a ZIP file using C#?

解决方案

DotNetZip:

class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files...

DotNetZip works on PCs with the full .NET Framework, and also runs on mobile devices that use the .NET Compact Framework. Create and read zip files in VB, C#, or any .NET language, or any scripting environment. DotNetZip supports these scenarios:

  • a Silverlight app that dynamically creates zip files.
  • an ASP.NET app that dynamically creates ZIP files and allows a browser to download them
  • a Windows Service that periodically zips up a directory for backup and archival purposes
  • a WPF program that modifies existing archives - renaming entries, removing entries from an archive, or adding new entries to an archive
  • a Windows Forms app that creates AES-encrypted zip archives for privacy of archived content.
  • a SSIS script that unzips or zips
  • An administrative script in PowerShell or VBScript that performs backup and archival.
  • a WCF service that receives a zip file as an attachment, and dynamically unpacks the zip to a stream for analysis
  • an old-school ASP (VBScript) application that produces a ZIP file via the COM interface for DotNetZIp
  • a Windows Forms app that reads or updates ODS files
  • creating zip files from stream content, saving to a stream, extracting to a stream, reading from a stream
  • creation of self-extracting archives.

If all you want is a better DeflateStream or GZipStream class to replace the one that is built-into the .NET BCL, DotNetZip has that, too. DotNetZip's DeflateStream and GZipStream are available in a standalone assembly, based on a .NET port of Zlib. These streams support compression levels and deliver much better performance than the built-in classes. There is also a ZlibStream to complete the set (RFC 1950, 1951, 1952)...

have fun

这篇关于如何解压ZIP文件在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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