Ionic Zip Library v1.9.1.6
ExtractWithPassword Method (password)
Extract the entry to the filesystem, using the current working directory
and the specified password.
Declaration Syntax
Parameters
- password (String)
- The Password to use for decrypting the entry.
Remarks
Existing entries in the filesystem will not be overwritten. If you would like to force the overwrite of existing files, see the ExtractExistingFileproperty, or call ExtractWithPassword(ExtractExistingFileAction, String).
See the remarks on the LastModified property for some details about how the "last modified" time of the created file is set.
Examples
In this example, entries that use encryption are extracted using a
particular password.
CopyC#
using (var zip = ZipFile.Read(FilePath)) { foreach (ZipEntry e in zip) { if (e.UsesEncryption) e.ExtractWithPassword("Secret!"); else e.Extract(); } }
CopyVB.NET
Using zip As ZipFile = ZipFile.Read(FilePath) Dim e As ZipEntry For Each e In zip If (e.UsesEncryption) e.ExtractWithPassword("Secret!") Else e.Extract End If Next End Using