SharArchive

SharArchive constructor (1 of 2)

Initializes a new instance of the SharArchive class.

public SharArchive()

Examples

The following example shows how to compress a file.

using (var archive = new SharArchive())
{
    archive.CreateEntry("first.bin", "data.bin");
    archive.Save("archive.shar");
}

See Also


SharArchive constructor (2 of 2)

Initializes a new instance of the SharArchive class prepared for decompressing.

public SharArchive(string path)
ParameterTypeDescription
pathStringPath to the source of the archive.

Exceptions

exceptioncondition
ArgumentNullExceptionpath is null.
SecurityExceptionThe caller does not have the required permission to access.
ArgumentExceptionThe path is empty, contains only white spaces, or contains invalid characters.
UnauthorizedAccessExceptionAccess to file path is denied.
PathTooLongExceptionThe specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
NotSupportedExceptionFile at path contains a colon (:) in the middle of the string.
FileNotFoundExceptionThe file is not found.
DirectoryNotFoundExceptionThe specified path is invalid, such as being on an unmapped drive.
IOExceptionThe file is already open.

See Also