What is the best/easiest way to create ZIP archive in .NET?

前端 未结 8 1836
感情败类
感情败类 2020-12-07 17:39

Which method do you think is the \"best\".

  • Use the System.IO.Packaging namespace?
  • Use interop with the Shell?
  • Third party librar
8条回答
  •  盖世英雄少女心
    2020-12-07 18:15

    The GZipStream and DeflateStream classes under System.IO.Compression namespace make it pretty easy to zip things up.

    UPDATE: Comments correctly state that these classes do not allow you to manipulate a Zip file. However, the J# dlls contain the required functionality in java.util and java.io namespaces. For more details see the Code Project article by dmihailescu which details their use and provides sample code.

提交回复
热议问题