How can I Compress a directory with .NET?

前端 未结 10 2715
孤街浪徒
孤街浪徒 2021-02-14 16:16

I have a directory that contains several files. I want compress this folder to a zip or tar.gz file. How can I do his work in C#?

10条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-14 16:40

    Look into using SharpZipLib. It supports both GZip and ZIP compression in C#.

    There is an excellent tutorial here outlining what you need to do to zip a directory with SharpZipLib.

提交回复
热议问题