Tutorial by Examples

System.IO.Compression.ZipFile.CreateFromDirectory("myfolder", "archive.zip") Create archive.zip file containing files which are in myfolder. In example paths are relative to program working directory. You can specify absolute paths.
System.IO.Compression.ZipFile.ExtractToDirectory("archive.zip", "myfolder") Extracts archive.zip to myfolder directory. In example paths are relative to program working directory. You can specify absolute paths.
' Create filestream to file Using fileStream = New IO.FileStream("archive.zip", IO.FileMode.Create) ' open zip archive from stream Using archive = New System.IO.Compression.ZipArchive(fileStream, IO.Compression.ZipArchiveMode.Create) ' create file_in_archive.txt in arch...
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. Add Imports System.IO.Compression to the top of your code file (before any class or module, with the other Imports statements)....

Page 1 of 1