In .NET earlier version, we used to depends on third party dll to generate the compressed files in .zip format. Suppose we have to compress multiple folders, then have to compress each and every folders and files. In .NET framework 4.5 introduced ZipFile class. It helps to compress the folders by one line.
ZipFile.CreateFromDirectory(startPath, zipPath);
StartPath - Source directory
ZipPath - Compressed file.
Alternatively you could extract the compressed files by
ZipFile.ExtractToDirectory(zipPath, extractPath);
more details, click here
Comments
Post a Comment