tags:

views:

2613

answers:

4

What are good libraries to use Unzip RAR and Zip files in .NET? Do they even exist? Do they cost money or are there also free ones?

+7  A: 

ZipLib - Free GPL - don't think it does rar though:

http://sharpdevelop.net/OpenSource/SharpZipLib/Default.aspx

You can use UnRAR.dll with P/Invoke:

http://www.rarlab.com/rar_add.htm

http://www.rarlab.com/rar/UnRARDLL.exe

Here's a .NET UnRAR libary:

http://www.chilkatsoft.com/rar-dotnet.asp

Kev
+1  A: 

Xceed (.com) do a good Zip component (along with many others).

You could also look at using the 7zip components or any of the others mentioned. SharpZipLib is fairly decent.

DavidWhitney
+1  A: 

DotNetZip is simple and easy to use, but it does only ZIP files, not RAR files. It's free, 100% managed code, open source.

Cheeso
A: 

Our Rebex ZIP is an example of a commercial one. Supports ZIP format only, not RAR.

In comparison with well-known SharpZipLib the Rebex ZIP contains a lot of samples and tutorials both in C# and VB.NET and the essential operations are extremely simple to write - compressing and decompressing can be written in one line of code:

// add content of the local directory C:\Data\  
// to the directory \Data-2010 (within the ZIP archive) 
// (ZIP archive C:\archive.zip doesn't have to exist) 
ZipArchive.Add(@"C:\archive.zip", @"C:\Data\*", @"\Data-2010");

// extract whole content of the ZIP archive 
// to the existing local directory C:\Data 
ZipArchive.ExtractAll(@"C:\archive.zip", @"C:\Data");

But also supports more complex features - encryption, recursive operations, working with streams and many others

Jan Šotola