Does anyone out there know how can i zip and unzip files using C#? I've googled but didn't find something useful . All useful replies will appreciated and will be given a +rep .
do you want actual source code in c# ? you can use http://www.winimage.com/zLibDll/minizip.html to unzip zip archives.
There's also http://icsharpcode.net/OpenSource/SharpZipLib/Default.aspx . Note that although the license is GPL, they have an explicit exception for using it in closed source applications. Why they didn't just pick LGPL is beyond me, but anyway...
I don't see that zLib code being for C# explicitly, while that's exactly what the link I gave you is for. Plus, almost by the license's definition it comes with code, right?
Zip: // 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"); Unzip: // extract whole content of the ZIP archive to the existing local directory C:\Data ZipArchive.ExtractAll(@"C:\archive.zip", @"C:\Data"); All using Rebex ZIP from www(dot)rebex(dot)net(slash)zip.net