Initializes a ZipArchive object with the specified ZIP file.

Namespace:  Rebex.IO.Compression
Assembly:  Rebex.Zip (in Rebex.Zip.dll)

Syntax

Visual Basic
Public Sub New ( _
	zipFilePath As String, _
	openMode As ArchiveOpenMode, _
	accessMode As ArchiveAccessMode _
)
C#
public ZipArchive(
	string zipFilePath,
	ArchiveOpenMode openMode,
	ArchiveAccessMode accessMode
)

Parameters

zipFilePath
Type: System..::..String
Path to a ZIP archive file.
openMode
Type: Rebex.IO.Compression..::..ArchiveOpenMode
Open mode - specified whether to open an existing ZIP archive, create new ZIP archive, etc.
accessMode
Type: Rebex.IO.Compression..::..ArchiveAccessMode
Access mode - specifies whether to open a ZIP file in read-write, read-only or auto mode.

Remarks

If no changes are to be made to the ZIP archive, use Read.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionzipFilePath is null.
System..::..ArgumentExceptionzipFilePath is empty or contains invalid characters. -or- The system could not retrieve the absolute path. -or- Invalid combination of the openMode and accessMode.
System..::..ArgumentOutOfRangeExceptionThe openMode or accessMode specified an invalid value.
System..::..NotSupportedExceptionPath is in an invalid format.
System.IO..::..PathTooLongExceptionThe specified path exceed the maximum length defined by system.
System.IO..::..DirectoryNotFoundExceptionPart of the specified path was not found.
System.IO..::..FileNotFoundExceptionThe specified file path was not found.
System.Security..::..SecurityExceptionThe caller does not have the required permissions.
System..::..UnauthorizedAccessExceptionAccess to the file is denied. -or- The specified path refers to a directory. -or- Path specified a file that is read-only and access is not Read.
System.IO..::..IOExceptionAn I/O error occurred.
Rebex.IO.Compression..::..ZipExceptionArchive cannot be opened (see ProblemType for detailed information).

Version Information

.NET Compact Framework

Supported in: 3.9, 3.5

See Also