Aspose.ZIP for .NET is a flexible and easy to use .NET API that lets you compress and extract, encrypt and decrypt files in almost all mainstream archive formats. It supports zip, gzip, bzip2, cab, tar, cpio, lzip, 7z, lzma, lz4, xz and Z format. It allows you to create self-extracting archives and extract RAR, lha, arj, lzx, wim formats as well.
$ dotnet add package Aspose.ZipProduct Page | Docs | API Reference | Examples | Blog | Search | Free Support | Temporary License
Aspose.ZIP for .NET is a class library that can be used by .NET developers for a variety of archive-processing tasks. It supports ZIP, GZIP, BZIP2, CAB, TAR, CPIO, LZIP, 7Z, LZMA, LZ4, XAR, XZ and Z formats. It allows you to encrypt and decrypt files, create self-extracting archives and extract RAR, WIM, ARJ formats as well. The API is easy to use, robust and written in managed code entirely to be used in .NET applications.
Aspose.ZIP for .NET is implemented using managed C# and can be used with any .NET language: C#, VB.NET, F#. It can be integrated with any kind of application, from ASP.NET web applications to forms applications within any OS: Windows/Linux/MacOS.
To become familiar with the most popular Aspose.ZIP functionality, please have a look at our free online applications.
Typical for Windows: ZIP, RAR, 7Z, CAB, WIM, ARJ
Typical for Unix/Linux: TAR, CPIO, SHAR; GZ, BZ2, LZ, XZ, LZMA, LZ4, XAR, ZSTD, Z
Typical for Amiga: LHA/LZH, LZX
So, you probably want to jump up and start coding your archive manipulatio on C#, F# or Visual Basic right away? Let us show you how to do it in a few easy steps.
Run Install-Package Aspose.Zip from the Package Manager Console in Visual Studio to fetch the NuGet package.
If you want to upgrade to the latest package version, please run Update-Package Aspose.Zip.
You can run the following code snippets in C# to see how our library works. Also feel free to check out the GitHub Repository for other common use cases.
The usage of Aspose.ZIP is simple for common scenarios.
using (var archive = new Archive()) // Instantiate an archive
{
archive.CreateEntry("first_entry.dat", "data.bin"); // Add an entry from file
archive.Save("archive.zip"); // Save composed archive to file
}using (var archive = new RarArchive("archive.rar")))
{
archive.ExtractToDirectory("extracted");
}// Instantiate an archive, providing compression and encryption settings
using (var archive = new SevenZipArchive(new SevenZipEntrySettings(new SevenZipLZMACompressionSettings(), new SevenZipAESEncryptionSettings("p@s$"))))
{
archive.CreateEntry("first_entry.dat", "data.bin");
archive.Save("archive.7z");
}