I am writing a Winform application in .NET 3.5, and I need unzip a .rar or .zip file.
I found many things, but I didn\'t found none 3rd party.
I couldn\'t change to .NET 4
If you only need to uncompress zip file, You don't need to add an external third party library.
Only you need is Add a reference to Microsoft Shell controls and Automation from the COM tab in the Reference Manager in Visual Studio.
private static void Unzip(String sourceFile,String destination)
{
Shell32.ShellClass sc = new Shell32.ShellClass();
Shell32.Folder SrcFlder = sc.NameSpace(sourceFile);
Shell32.Folder DestFlder = sc.NameSpace(destination);
Shell32.FolderItems items = SrcFlder.Items();
DestFlder.CopyHere(items, 20);
}
With this, you don't have to distribute any additional dll file with your application.