' 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 archive
Dim zipfile = archive.CreateEntry("file_in_archive.txt")
' write Hello world to file_in_archive.txt in archive
Using sw As New IO.StreamWriter(zipfile.Open())
sw.WriteLine("Hello world")
End Using
End Using
End Using