Asad Hasnaini Asad Hasnaini - 8 days ago 10
C# Question

How to unrar an archive in dotnet core?

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

Answer

The ZipFile class from System.IO.Compression supports both .zip and .rar archives.

You can open an archive like this:

using(ZipArchive za = ZipFile.OpenRead(strPath))  
{
    //do something with `za.Entries` or with other properties
}
Comments