C# | Visual Basic | Visual C++ |
public void ExtractAll( string path, ExtractExistingFileAction extractExistingFile )
Public Sub ExtractAll ( _ path As String, _ extractExistingFile As ExtractExistingFileAction _ )
public: void ExtractAll( String^ path, ExtractExistingFileAction extractExistingFile )
- path (String)
- The path to which the contents of the zipfile will be extracted. The path can be relative or fully-qualified.
- extractExistingFile (ExtractExistingFileAction)
- The action to take if extraction would overwrite an existing file.
This method will extract all entries in the ZipFile to the specified path. For an extraction that would overwrite an existing file, the behavior is dictated by extractExistingFile, which overrides any setting you may have made on individual ZipEntry instances.
The action to take when an extract would overwrite an existing file applies to all entries. If you want to set this on a per-entry basis, then you must use Extract(String, ExtractExistingFileAction) or one of the similar methods.
Calling this method is equivalent to setting the ExtractExistingFile property and then calling ExtractAll(String).
This method will send verbose output messages to the StatusMessageTextWriter, if it is set on the ZipFile instance.
String TargetDirectory= "c:\\unpack"; using(ZipFile zip= ZipFile.Read(ZipFileToExtract)) { zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite); }
Dim TargetDirectory As String = "c:\unpack" Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite) End Using