Question

I'm trying to test if an 7zip arhive is corrupted or not, I found a good reference to add to my project, it's called SevenZipSharp.dll, but I can't find a help file to show me how, does anyone know how to use this library or another method.

Was it helpful?

Solution

SevenZipExtractor Class (Class for extracting and getting information about 7-zip archives)

SevenZipExtractor zipfile=new SevenZipExtractor("path to your archive");
if (zipfile.Check())
{
MessageBox.Show("Your archive or zip is ok");
}
else
{
MessageBox.Show("Your archive or zip is not ok");
}

Download the library from: http://sevenzipsharp.codeplex.com

The documentation for the library is present in a chm file. Check that for cross reference

OTHER TIPS

The SevenZipExtractor class has a Check method that according to the XML doc:

    /// <summary>
    /// Performs the archive integrity test.
    /// </summary>
    /// <returns>True is the archive is ok; otherwise, false.</returns>

The SevenZipSharp source code is available in the CodePlex code repository. Reviewing it should be able to answer any questions you have about the library.

This is an excellent (award-winning) article by Eugene Sichkar on using 7Zip DLLs in C#.

This should help, if not, at least point you in the right direction.

Cheers!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top