Adds specified local files or directories to a directory within the ZIP archive.

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

Syntax

C#
public ArchiveOperationResult Add(
	string sourcePathOrMask,
	string archiveDirectoryPath
)
Visual Basic (Declaration)
Public Function Add ( _
	sourcePathOrMask As String, _
	archiveDirectoryPath As String _
) As ArchiveOperationResult
Visual C++
public:
ArchiveOperationResult^ Add(
	String^ sourcePathOrMask, 
	String^ archiveDirectoryPath
)

Parameters

sourcePathOrMask
Type: System..::.String
Path (with or without a mask) to an external (local) file or directory.
archiveDirectoryPath
Type: System..::.String
Path to an archive directory where to add files. Null reference (Nothing in Visual Basic) means root.

Return Value

Operation result.

Exceptions

ExceptionCondition
System..::.ArgumentNullExceptionsourcePathOrMask is null.
System..::.ArgumentExceptionThe specified path is empty or contains invalid characters. -or- The system could not retrieve the absolute path.
System..::.InvalidOperationExceptionArchive is not opened for writing. -or- Illegal use of wildcards in path. -or- sourcePathOrMask refers to the ZIP archive itself.
System..::.ObjectDisposedExceptionArchive was already disposed.
System..::.NotSupportedExceptionPath is in an invalid format.
System.IO..::.PathTooLongExceptionsourcePathOrMask exceed the maximum length defined by sestem. -or- The target path is longer than 65.535 characters.
System.Security..::.SecurityExceptionThe caller does not have the required permissions.
System..::.UnauthorizedAccessExceptionAccess to the file is denied.
System.IO..::.IOExceptionAn I/O error occured.
Rebex.IO.Compression..::.ZipExceptionCannot perform the requested operation, or the operation was canceled (see ProblemType for detailed information).

See Also