I've tried to use CheckZip in DotNetZip to test about 22.000 zip files, and it doesn't report any errors. WinRAR however reports "archive is corrupted" for a number of these files, so I wonder what's going on here, and if I've implemented CheckZip correctly. If I rename a text file to test.zip and check it I get a "test.zip is not a valid zip file" from DotNetZip so it looks like it's basically working though. Code looks like this:
public static bool CheckZip(string zipFileName)
{
try
{
return ZipFile.CheckZip(zipFileName);
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
return false;
}
}
UPDATE: found a simple solution here, using SharpZipLib instead. Works fine.