Adding File Compression to your project
- In Solution Explorer go to your project, right click on References then Add reference…
- Search for Compression and select System.IO.Compression.FileSystem then press OK.
Imports System.IO.Compressionto the top of your code file (before any class or module, with the other
Plese note that this class (ZipArchive) is only available from .NET verison 4.5 onwards
Create zip archive dynamicaly
Creating zip archive from directory
Create archive.zip file containing files which are in
myfolder. In example paths are relative to program working directory. You can specify absolute paths.
Extracting zip archive to directory
Extracts archive.zip to myfolder directory. In example paths are relative to program working directory. You can specify absolute paths.