Click or drag to resize

ZipAccess class

Function: Routines for packing and unpacking ZIP archives. Uses SevenZipSharp.dll, System.IO.Compress and SevenZip The routines beginning with Ics are based on 'ICSharpCode.SharpZipLib.dll' and 7Zip.
Inheritance hierarchy
SystemObject
  NetEti.FileTools.ZipZipAccess

Namespace: NetEti.FileTools.Zip
Assembly: NetEti.ZipAccess (in NetEti.ZipAccess.dll) Version: 1.0.0+90532d84a01ea1dad6525ec1859a76670aba8306
Syntax
public class ZipAccess : IDisposable

The ZipAccess Type exposes the following members.

Constructors
 NameDescription of the
Public MethodZipAccess Standard constructor - Sets the path to the appropriate 7Zip dll (32/64).
Back to the top
Methods
 NameDescription of the
Public MethodAbortion Must be called in the external EventHandler, if the current process is to be cancelled.
Protected Methoddispose You can tidy up here.
Public MethodDispose Public method for cleaning up.
Protected MethodFinalise Finaliser: is called by the GarbageCollector.
(Overwrites ObjectFinalise)
Public MethodGetZipEntryList Returns the table of contents of the zip archive as a string list.
Public MethodIsZip Checks whether a file is a zip archive.
Public MethodUnzipAllArchives Unpacks all ZIP archives from the zipsFolder directory into a New subdirectory with the name of the archive in the outputFolder.
Public MethodUnZipArchive Unpacks everything from the archive including subdirectory structures.
Public MethodUnZipArchiveFiles Unpacks everything from the archive including subdirectory structures.
Public MethodZipDirectory Packs everything from the inputFolderPath directory into the archive zipPathAndFile incl. subdirectory structures.
Public MethodZipFiles Packs the files from "filePathes" into an archive "zipPathAndFile". Optionally, a password can be entered.
Back to the top
Events
 NameDescription of the
Public EventZipProgressChanged Event that occurs when the progress of ZipAccess changes.
Public EventZipProgressFinished Event that occurs when ZipAccess is terminated.
Back to the top
Remarks
File: ZipAccess.cs
Microsoft's own routines put on their ears for archives > 4GIG and cannot recognise passwords!
Author: Peter Bromberg (http://www.eggheadcafe.com/tutorials/aspnet/9ce6c242-c14c-4969-9251-af95e4cf320f/zip--unzip-folders-and-f.aspx)
Many thanks for that. tweaked by: Erik Nagel, NetEti

09.03.2012 Erik Nagel: created
26.03.2012 Erik Nagel: Error correction for ZIPs with multiple entries. 30/03/2012 Erik Nagel: Changeover from static to instantiated due to problems with cancellation and restart; Progress reports on events and more information. 25.04.2013 Erik Nagel: Archives are now unpacked with SevenZipSharp.SevenZipExtractor. 26.04.2013 Erik Nagel: 7zip.dll is now loaded differently for 32bit or 64bit systems (7z32.dll/7z64.dll). 2014-02-16 Erik Nagel: Path for 7zip.dll is now prepared via HTMLEncode. 16/17.10.2016 Erik Nagel: Revised and restructured. 2017-10-11 Erik Nagel: Exceptions caught with 7Zip on newer Windows(Deflate?) formats and redirected to System.IO.Compression routines.
See also