How to Open 7Zip Archive Using C#

In order to view a 7zip archive, we’ll use

Aspose.ZIP for .NET

API which is a feature-rich, powerful and easy to use API. It allows to open and view 7Zip, TAR, 7ZIP, CPIO, XAR, RAR file formats on .NET platform without installing any software like WinRAR or 7ZIP. Moreover, developers can convert archive to another format. To add the reference, Open

NuGet

package manager, search for Aspose.ZIP and install. You may also use the following command from the Package Manager Console.

Package Manager Console Command


PM> Install-Package Aspose.Zip

Steps to View Entries of 7Zip archive via C#

Opening 7Zip archive to review entries consist of following steps:

  1. Compose 7Zip archive, prepared for decompression. For this purpose supply the path to the compressed file within SevenZipArchive constructor.
  2. Now Entries property of the SevenZipArchive contains the list of SevenZipArchiveEntry.
  3. Use Name property of SevenZipArchiveEntry to find out the name and path of the entry. You can look at other properties for some more details.

7Zip Viewer Requirements

Before executing the code below, please make sure that you have the following prerequisites on your system.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core
  • Development environment like Microsoft Visual Studio
  • Aspose.ZIP for .NET DLL referenced in your project
  • Add namespace in relevant class file
 

Open 7Zip Archive - C# code example

 

Free App to Open 7Zip

Check our live demos for 7Zip viewer with following benefits.

  No need to download or setup anything.
  No need to write any code.
  Just upload your 7Zip archives and hit the "View" button.
  You will instantly get the link for opened 7Zip file.
A reliable Aspose.ZIP Library that can compress, extract, encrypt, decrypt, convert and merge archives. Aspose.ZIP for .NET API allows to manipulate various archive types without without going into the underlying complexity of the compress file formats with minimum coding efforts.

Other Supported View archives

You can also view other archive formats including few listed below.

ZIP (Zipped (compressed) Files)
7ZIP (7zip Archive)
CPIO (Copy In, Copy Out Archive)
RAR (Roshal Archive Compressed file)
TAR (Tape Archive)
XAR (eXtensible ARchive format)