I need to extract a splitted rar-file (r00, r01, r02,...) in C#.
The only thing I've found that might be useful, is sevenzipsharp. I cannot find an example of what I'm trying to do though.
Someone said "docs available at https://archive.codeplex.com/?p=sevenzipsharp", but that dosen't really help since I can't find any examples there.
I know that everything would be a lot easier if I use a different compression format, but I'm not responsible for the generation of the zip files so that is unfortunately not an option.
* UPDATE 01/17/2019 *
I tried:
namespace test
{
class Program
{
static void Main(string[] args)
{
// Toggle between the x86 and x64 bit dll
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Environment.Is64BitProcess ? "x64" : "x86", "7z.dll");
SevenZip.SevenZipBase.SetLibraryPath(path);
using (var file = new SevenZipExtractor(@"F:\ziptest\test.part1.rar"))
{
file.ExtractArchive(@"F:\dav\");
}
}
}
}
But that gives me an error, when calling "ExtractArchive":
An unhandled exception of type 'SevenZip.SevenZipArchiveException' occurred in SevenZipSharp.dll
Additional information: Invalid archive: open/read error! Is it encrypted and a wrong password was provided?
* UPDATE 01/20/2019 *
I ended up using the solution provide here: Unrar an archive in C#
I modified the switch parameters so that WinRar runs in the background without opening any windows.
If someone do come up with a solution to my problems with SevenZipSharp I would still like to know, as it is a more "clean" code.