Aspose.ZIP for .NET is a flexible documents compression and archive manipulation API for standard ZIP format. API enables .NET applications to achieve files compression/decompression, archiving files as well as folders and encryption of archives. This API works with all well known archive formats: ZIP, RAR, 7Zip, GZIP, BZ2. And with many archive formats from Linux: CPIO, TAR, Lzip, Bzip2, XZ, Z. It provides protection via user-defined passwords and traditional encryption using ZipCrypto or AES encryption such as AES128, 192 and AES256.

Aspose.Zip introduces a robust .NET API for File Compression and Archiving, meticulously crafted to meet the evolving demands of contemporary data management. This comprehensive library empowers developers to efficiently compress, archive, and extract files within the .NET framework, ensuring seamless integration and unparalleled performance.

In recent years, the .NET framework has solidified its position as a versatile platform for various applications, from web development to enterprise solutions. Aspose.Zip aligns with this trend, offering a sophisticated toolset for handling file compression tasks, contributing to the efficiency and reliability of ZIP NET based software development.

Advanced .NET Compression & Archiving API Features

Easy Integration

Create an archive from one or more files

Add entries to existing archive

Compress folder respecting its structure

Decompress to directory respecting archive structure

Compress any size documents by applying parallelism

Integrating Compression API in a .NET Application

The compression library integration is simple whereas most of the compress & decompress operations can be performed with just a few lines of code.

Single file compression - C#

      var dir = "full directory path";

      using (var arch = new Archive()){

        arch.CreateEntry("filename.dat", dir+"file.dat");
        arch.Save(dir+"result.zip");

    } 

How to Convert Zip Using C#

In .NET, you can use the ZipFile class to work with ZIP files and compression. If encryption is required, you may want to look into libraries or methods that support password protection for ZIP archives. Always ensure proper security practices when handling sensitive data and encryption in your applications.

The Compression API in a ZIP .NET application refers to a set of functionalities that enable developers to efficiently compress and decompress data. It provides a standardized way to implement data compression algorithms, improving storage efficiency and reducing data transfer times. With the Compression API in .NET, developers can choose from various compression algorithms, such as gzip or deflate, and seamlessly integrate them into their applications. This feature is particularly valuable when working with large datasets or when optimizing network communication in web applications, contributing to enhanced performance and resource utilization.

Convert from ZIP to 7Z via .NET

  using (SevenZipArchive sevenZipArchive =  new SevenZipArchive())
  {
    using (Archive archive = new Archive("source.zip"))
    {
      for (int i = 0; i < archive.Entries.Count; i++)
      {
        var ms = new MemoryStream();
        archive.Entries[i].Extract(ms);
        ms.Seek(0, SeekOrigin.Begin);
        sevenZipArchive.CreateEntry(archive.Entries[i].Name.Replace('\\', '/'), ms);
      }
    }

    sevenZipArchive.Save("output.7z");
  }

The code snippet showcases the conversion of a ZIP archive to a 7Z format via C#. Leveraging the SevenZipArchive library, the script extracts the ZIP entries and creates corresponding entries in the 7Z archive.

Other Supported Aspose.ZIP for .NET API Features

Use the Aspose.ZIP C# library to convert, merge, edit zip-file documents, extract data from the arhives, and more!

  

Support and Learning Resources

  
  

Aspose.Zip offers individual archive processing APIs for other popular development environments, listed below: