Code:
Private Sub Unzip(ByVal filename As String)
Dim inputStream As New ZipInputStream(File.OpenRead(filename))
Dim entry As ZipEntry = Nothing
Dim nBytes As Integer = 2048
Dim data As Byte() = New Byte(2047) {}
While (entry = inputStream.GetNextEntry()) IsNot Nothing
If entry.Name.ToUpperInvariant().EndsWith("ZIP") Then
Dim ms As New MemoryStream()
While (nBytes = inputStream.Read(data, 0, data.Length)) > 0
ms.Write(data, 0, nBytes)
End While
ms.Position = 0
Dim tempStream As New ZipInputStream(ms)
Dim tempEntry As ZipEntry = Nothing
While (tempEntry = tempStream.GetNextEntry()) IsNot Nothing
Dim nBytes2 As Integer = 2048
Dim data2 As Byte() = New Byte(2047) {}
While (nBytes2 = tempStream.Read(data2, 0, data2.Length)) > 0
ResultBox.AppendText(New ASCIIEncoding().GetString(data2, 0, nBytes2))
End While
End While
End If
End While
inputStream.Close()
End Sub
habe diesen Code grade dank google gefunden.
Ich weis nicht ob es geht aber dem ein oder anderen hilft es bestimmt.
mfG