3

Is there a library builtin that could be used to extract rar files in dotnet core? I found something to extract zip files, but nothing for rar files. Used 7zip in 4.5

Martin Serrano
  • 3,727
  • 1
  • 35
  • 48
Asad Ali
  • 151
  • 1
  • 12

1 Answers1

6

It seems like there is nothing builtin to extract multipart rar files in .net. There are libraries for .net but not dotnet core as described here. (maybe they can easily be ported)

The ZipFile class from System.IO.Compression supports both .zip and .rar (not multipart) archives.

You can open an archive like this:

using(ZipArchive za = ZipFile.OpenRead(strPath))  
{
    //do something with `za.Entries` or with other properties
}
Community
  • 1
  • 1
NtFreX
  • 10,379
  • 2
  • 43
  • 63
  • 2
    This I believe works for a single rar but didn't work for a multipart rar file – Asad Ali Nov 28 '16 at 14:07
  • @AsadHasnaini You could try to port the [C# (.net) interface for 7-Zip archive dlls](http://dev.nomad-net.info/articles/sevenzipinterface) library which is in the answer I edited into the post – NtFreX Nov 28 '16 at 14:30
  • 1
    Doesn't even seem to work with non-multipart rar files either. – Scott Wilson Oct 21 '21 at 21:30