How to use System.IO.Compression to read/write ZIP files?

后端 未结 8 1564
灰色年华
灰色年华 2020-12-08 08:13

I know there are libraries out there for working with ZIP files. And, you can alternatively use the functionality built into Windows for working ZIP files.

But, I\'m

8条回答
  •  北海茫月
    2020-12-08 08:34

    Since .NET 4.5, Microsoft has offered the ZipArchive class to the System.IO.Compression namespace. Unlike other classes in that namespace, though, like GZipStream and Deflate stream, the ZipArchive requires a reference to the System.IO.Compression.dll assembly.

    It's fairly simple to use, and the link above to MSDN provides some good examples.

    Additionally, Microsoft has created the Microsoft Compression NuGet package, which adds support for ZipArchive and related classes to Windows Phone 8 and other Portable Class Libraries

提交回复
热议问题