Handling Zip Files Without Third Party Lib in .NET 4.0?

后端 未结 4 1080
梦谈多话
梦谈多话 2020-12-18 18:58

There is a similar question for 3.5 here:

Is there a built-in zip library in .NET 3.5?

that speculated that 4.0 would have it, but I can\'t find any info abo

相关标签:
4条回答
  • 2020-12-18 19:14

    Not for 4.0, but a ZipArchive class is being considered for the next version. You can find details about this on the BCL Team blog.

    Edit: Otherwise, assuming that it's still available, and depending on your definition of built in (at least it comes/came with Visual Studio), you might be able to use the J# classes to zip files as described in this article: Using the Zip Classes in the J# Class Libraries to Compress Files and Data with C#

    Edit2: Though note the comments below, that the J# option is probably not the right option except in certain unusual circumstances.

    0 讨论(0)
  • 2020-12-18 19:15

    You may have already moved along, but ZiP API is added in .NET 4.5

    http://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive.aspx

    go nuts.

    0 讨论(0)
  • 2020-12-18 19:21

    Most easiest to deal with, is with sample code here.

    You need to add a new assembly just to find he Zip archive.

    Working with Zip files in .NET 4.5

    0 讨论(0)
  • 2020-12-18 19:37

    Take a look at the System.IO.Packaging namespace, which contains support for ZIP files, but not all of the features of ZIP files.

    Still, it might be enough for your needs.

    0 讨论(0)
提交回复
热议问题