Sample code for 30+ languages & platforms
VB.NET

Unzip Text File to String

See more Zip Examples

Demonstrates how to open a .zip and extract the 1st file (assuming it's a text file) to a string variable.

Chilkat VB.NET Downloads

VB.NET
Dim success As Boolean = False

' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

Dim zip As New Chilkat.Zip

success = zip.OpenZip("qa_data/zips/EC16100.zip")
If (success = False) Then
    Debug.WriteLine(zip.LastErrorText)
    Exit Sub
End If


' Get the 1st file in the .zip
Dim entry As New Chilkat.ZipEntry
success = zip.EntryAt(0,entry)
If (success = False) Then
    Debug.WriteLine(zip.LastErrorText)
    Exit Sub
End If


Dim fileContents As String = entry.UnzipToString(0,"utf-8")
Debug.WriteLine(fileContents)