ZipArchive.ExtractAll Method


Unzip all files in current zip file to specified folder.

[Visual Basic]
Public Sub ExtractAll( _
    path As String, _
    password As String _
)

[C#]
public void ExtractAll(
    string path,
    string password
);

[C++]
public: void ExtractAll(
    String* path,
    String* password
);

[JScript]
public function ExtractAll( 
    path: String,
    password: String
);

Parameters

path
The target path.
password
The password for decryption.

Example

[Visual Basic, C#, C++] The following example demonstrates how to compress/decompress file with EACompression Zip Component. This sample doesn't demonstrates the events, please refer to Samples section to get the full samples of EACompression.

[Visual Basic]
Imports EACompression
Imports System.IO

[Visual Basic]
Imports EACompression

Sub Unzip()
    Try
        Dim oZip As New ZipArchive("TryIt")
        oZip.Load("c:\test.zip")
        Dim password As String = ""
        
        oZip.ExtractAll( "c:\unzipped", password ) 
      
    Catch ep As Exception
        Console.Write(ep.Message)
    End Try
End Sub


[C#]
using System;
using System.Collections;
using System.IO;
using EACompression;

void Unzip( )
{
    try
    {
        ZipArchive oZip = new ZipArchive( "TryIt" );
        oZip.Load( "c:\\test.zip" );
        string password = "";
        
        oZip.ExtractAll( "c:\\unzipped", password ); 
    }
    catch( Exception ep )
    {
        Console.Write( ep.Message );
    }
}


[C++]
using namespace System;
using namespace System::Collections;
using namespace System::IO;
using namespace EACompression; 

void Unzip( )
{
    try
    {
        ZipArchive *oZip = new ZipArchive( S"TryIt" );
        oZip->Load( S"c:\\test.zip" );
        String *password = S"";

        oZip->ExtractAll( S"c:\\unzipped", password ); 
    }
    catch( Exception *ep )
    {
        Console::Write( ep->Message );
    }
}

See Also

Handle file overwriting and path structure
Encrypt and decrypt file with password