Extract Open 7z

Introduktion

7z-filer är kända för sina exceptionella komprimeringssatser, vilket gör dem till ett föredraget val för datalagring och överföring.I den här guiden lär du dig hur du öppna eller utvisa 7z (7zip)-filer programmatiskt med C# i dina applikationer.

Tabell av innehåll

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

To work with 7z files in your applications, you can utilize the Aspose.ZIP för .NET API. This robust library supports a variety of compressed formats, including ZIP, RAR, and 7z.

För att börja installera API via NuGet med följande kommando:

PM> Install-Package Aspose.Zip

Öppna eller extrahera 7z fil (7zip) Programmatiskt med C#

För att öppna eller utvisa 7z-filer programmatiskt följer du följande steg:

  • Load the input 7z (7zip) archive using the SevenZipArchive class.
  • Use the ExtractToDirectory method to extract all files from the 7zip archive to a specified directory.

Här är en provkod snippet:

using Aspose.Zip.SevenZip;
using System.IO;

class Program
{
    static void Main()
    {
        using (SevenZipArchive archive = new SevenZipArchive("input.7z"))
        {
            archive.ExtractToDirectory("output_folder");
        }
    }
}

Extract or Unzip Password-Protected 7zip File med C#

För att extrahera en lösenordsskyddad 7zip-fil, följ dessa steg:

  • Ladda ner den krypterade 7z-arkivet.
  • Use the ExtractToDirectory method, providing the password.

Här är genomförandet:

using Aspose.Zip.SevenZip;
using System.IO;

class Program
{
    static void Main()
    {
        using (SevenZipArchive archive = new SevenZipArchive("protected.7z"))
        {
            archive.ExtractToDirectory("output_folder", "your_password");
        }
    }
}

Få gratis API licens

You can evaluate the Aspose.ZIP API without any limitations by requesting a Fri tillfällig licens.

slutsatser

In this article, you learned how to open or extract 7z files programmatically using C#. You also explored methods for handling password-protected archives in your .NET applications. For further assistance, visit the Gratis supportforum or check out our API Dokumentation.

Med Aspose Plugin kan du hantera 7z filhantering utan ansträngning, vilket gör det till ett viktigt verktyg för att implementera programmatisk 7z extraction i dina .NET-applikationer. Om du letar efter ytterligare resurser, överväga att använda en Online 7-z File Opener eller undersöka hur man extraherar en 7-Z fil med hjälp av C# 7zip effektivt.

More in this category