Friday, 13 March 2015

Zip and UnZip the folder using C# [.net 4.5 feature]

I used to use some third party dll for zipping the folders. Now there is no need to use other dll, .net 4.5 gave a namespace for it.

using System.IO.Compression;

Here is the code of creating a zip folder and extracting the content from zipped folder

ZipFile.CreateFromDirectory(@"D:\Contents", @"D:\Contents.zip");

ZipFile.ExtractToDirectory(@"D:\Contents.zip", @"D:\Contents");

--
Happy Coding
Gopinath

No comments:

Post a Comment