Create normal zip file programmatically

Just an update on this for anyone else who stumbles across this question.

Starting in .NET 4.5 you are able to compress a directory using System.IO.Compression into a zip file. You have to add System.IO.Compression.FileSystem as a reference as it is not referenced by default. Then you can write:

System.IO.Compression.ZipFile.CreateFromDirectory(dirPath, zipFile);

The only potential problem is that this assembly is not available for Windows Store Apps.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)