Extract Method (baseDirectory)

DotNetZip

Ionic Zip Library v1.9.1.6 Extract Method (baseDirectory)
ReferenceIonic.ZipZipEntryExtract(String)
Extract the entry to the filesystem, starting at the specified base directory.
Declaration Syntax
C# Visual Basic Visual C++
public void Extract(
	string baseDirectory
)
Public Sub Extract ( _
	baseDirectory As String _
)
public:
void Extract(
	String^ baseDirectory
)
Parameters
baseDirectory (String)
the pathname of the base directory
Remarks

Using this method, existing entries in the filesystem will not be overwritten. If you would like to force the overwrite of existing files, see the ExtractExistingFile property, or call Extract(String, ExtractExistingFileAction).

See the remarks on the LastModified property, for some details about how the last modified time of the created file is set.

Examples
This example extracts only the entries in a zip file that are .txt files, into a directory called "textfiles".
CopyC#
using (ZipFile zip = ZipFile.Read("PackedDocuments.zip"))
{
  foreach (string s1 in zip.EntryFilenames)
  {
    if (s1.EndsWith(".txt"))
    {
      zip[s1].Extract("textfiles");
    }
  }
}
CopyVB.NET
Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip")
    Dim s1 As String
    For Each s1 In zip.EntryFilenames
        If s1.EndsWith(".txt") Then
            zip(s1).Extract("textfiles")
        End If
    Next
End Using

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)