Looking to extract ZIP archives programmatically? This article shows the simplest way to extract ZIP files using C# in just a few steps.

In the previous article you learned how to create ZIP files and folders with Aspose.ZIP for .NET. This article explains how to extract ZIP files and unzip password‑protected or AES‑encrypted archives in C#.
- C# API to Unzip Files - Free Download
- Unzip ZIP Files in C#
- Unzip Password-protected ZIP Files
- Extract AES Encrypted ZIP Files in C#
Extract ZIP Archives in C# - API Installation
Before we start, make sure you have downloaded and referenced Aspose.ZIP for .NET or installed its package using NuGet Package Manager in your project.
PM> NuGet\Install-Package Aspose.Zip
How to Extract ZIP Files in C#
You can extract ZIP files in two ways:
- Extract each file in ZIP separately
- Extract files into a specified folder
In the first method, you can explicitly access and extract each file in the ZIP archive. You can also print the extraction progress. The second method simply extracts all files into the target folder.
C# Extract Each File in ZIP
Follow these steps to open a ZIP file in C# and display extraction progress:
- Open the ZIP archive into a FileStream object.
- Create and initialize Archive’s instance with the FileStream object.
- Access files in the ZIP using Archive.Entries collection.
- Set ArchiveEntry.ExtractionProgressed event handler to print the extraction progress.
- Extract files using ArchiveEntry.Extract(string) method.
The following code sample shows how to extract files in a ZIP archive in C#.
Unzip ZIP Files into a Folder in C#
Use these steps to unzip files into a specific folder in C#.
- Open the ZIP archive using the FileStream class.
- Create an instance of Archive class and initialize it with ZIP’s FileStream object.
- Unzip files using Archive.ExtractToDirectory(string) method.
The following C# code sample unzips ZIP files into a folder.
C# Unzip Password-Protected ZIP Files
Aspose.ZIP for .NET can unzip password‑protected archives. Just provide the password via the ArchiveLoadOptions class when creating the Archive instance.
The following is the sample code to unzip a password‑protected ZIP file.
Extract AES Encrypted ZIP Files in C#
ZIP archives can be AES‑encrypted (AES‑128, AES‑192, AES‑256). Aspose.ZIP for .NET handles AES decryption the same way as password protection—just set the password with ArchiveLoadOptions.
The following code sample shows how to extract AES encrypted ZIP files in C#.
C# ZIP Extraction API - Get a Free License
You can extract ZIP archives without evaluation limitations by getting a free temporary license.
Conclusion
This article showed how to unzip files in C#, including password‑protected and AES‑encrypted archives. Explore more about Aspose.ZIP for .NET in the documentation.