Extractor universal pentru .NET

Introducere la Universal Extractor pentru .NET

Universal Extractor pentru .NET este un plugin care permite dezvoltatorilor să extragă arhivele și fișierele comprimate în diferite formate, inclusiv ZIP, RAR, 7Z, TAR, GZIP și multe altele.

Formate de arhivă susținute

Extractorul universal pentru .NET susține o gamă largă de formate de arhivă, inclusiv:

  • Cuvânt cheie: .zip
  • Războiul ( .rar )
  • 7 Z ( .7 Z )
  • Războiul ( .tar )
  • GZIP ( .gz )
  • BZIP2 (.bz2) în funcție de

Arhivă extract

Pentru a extrage un arhiv folosind Universal Extractor pentru .NET, puteți folosi următorul exemplu de cod:

using System.IO;
using Aspose.Zip;

// Create a new instance of the Archive class
using (var archive = new Archive("example.zip"))
{
    // Extract the archive to a directory
    archive.ExtractToDirectory("extracted");
}

This code extracts the contents of the example.zip archive to a directory named extracted.

Extragerea arhivelor cu protectia parolelor

Dacă un arhiv este protejat cu parola, îl puteți extrage folosind următorul exemplu de cod:

using System.IO;
using Aspose.Zip;

// Create a new instance of the Archive class
using (var archive = new Archive("example.zip"), new ArchiveLoadOptions() { DecryptionPassword = "YOUR-PASSWORD" })
{
    // Extract the archive to a directory
    archive.ExtractToDirectory("extracted");
}

This code extracts the contents of the example.zip archive, which is protected with a password, to a directory named extracted.

Arhivă conținut

Pentru a lista conținutul unui arhiv fără a-l extrage, puteți folosi următorul exemplu de cod:

using System.IO;
using Aspose.Zip;

// Create a new instance of the Archive class
using (var archive = new Archive("example.zip"))
{
    // Get the entries in the archive
    var entries = archive.Entries;

    // Iterate over the entries and print their names
    foreach (var entry in entries)
    {
        Console.WriteLine(entry.Name);
    }
}

This code lists the contents of the example.zip archive without extracting it.

 Română