Open or Extract 7z (7zip) File Programmatically using C# .NET

Extract Open 7z

7z files are popular as they have a good compression ratio. You can open or extract a 7z (7zip) file in your C# applications. Please check out the following sections to learn how to create 7z file extractor and unzip password-protected archives:

7z File (7zip) Extractor – C# API Installation

Aspose.ZIP for .NET API can compress or extract different compressed formats including ZIP, RAR, 7z, etc. You can create a 7z file (7zip) extractor in .NET applications. Please download the DLL file from the Downloads section, or install it with the following NuGet command:

PM> Install-Package Aspose.Zip

Open or Extract 7z File (7zip) Programmatically using C#

You can open or extract 7z file (7zip) with the following steps:

  1. Load input 7z (7zip) Archive with SevenZipArchive class.
  2. Extract all files in 7zip to a directory using the ExtractToDirectory method.

The following code shows how to open or extract 7z file programmatically using C#:

Extract or Unzip Password Protected 7zip File using C#

Some 7z files may be encrypted with password protection. For instance, when you need to avoid unauthorized access of data. You can extract or unzip a password protected 7zip file with the steps below:

  1. Load password-protected input 7z archive.
  2. Extract or open 7z archive with password using ExtractToDirectory method.

The code below explains how to extract or unzip a password protected 7zip file programmatically using C#:

Get Free API License

You can evaluate the API without any of the Evaluation Limitation by requesting a Free Temporary License.

Conclusion

In this article, you have learned how to open or extract 7z files (7zip) programmatically using the C# language. Moreover, you have also explored how to unzip a password-protected or encrypted 7z file in .NET-based applications. You can reach out to us at Free Support Forum, or visit API Documentation for checking out other features of the API.

See Also

Unrar or Extract Files Programmatically using C#