' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.Collections
Imports System.IO
Imports ICSharpCode.SharpZipLib.Zip

Class MainClass
    Public Shared Sub Main(ByVal args As String())
        Dim zf As ZipFile = New ZipFile("C:\z.zip")
        Dim e As IEnumerator = zf.GetEnumerator
        While e.MoveNext
            Dim ze As ZipEntry = CType(e.Current, ZipEntry)
            Dim istm As Stream = zf.GetInputStream(ze)
            Dim ostm As Stream = New FileStream("C:\" + ze.Name, FileMode.CreateNew, FileAccess.Write)
            Dim b(100000) As Byte
            Dim n As Integer = istm.Read(b, 0, b.Length)
            While n > 0
                ostm.Write(b, 0, n)
                n = istm.Read(b, 0, b.Length)
            End While
            ostm.Close
        End While
        zf.Close
    End Sub
End Class 
