-2

So im trying to use zip files in my program, but i cannot get even basic function to work from io.compression, namely open read:

Imports System.IO
Imports System.IO.Compression

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim zipPath As String = "d:\test\testzip.zip"

        Using archive As ZipArchive = ZipFile.OpenRead(zipPath)
            For Each entry As ZipArchiveEntry In archive.Entries
                ListBox1.Items.Add(entry.FullName)
            Next
        End Using
    End Sub
End Class

What im trying to do here is list filenames of files contained in zip archive to listbox.

visual studio just breaks application from running without giving me any errors. This is pretty much just as example on msdn. I did add references to system.io.compression and system.io.compression.filesystem.

Zabujca
  • 23
  • 4

1 Answers1

0

Mind if i suggest XCeed ?

Sample :

Imports Xceed.Zip
Imports Xceed.FileSystem

Dim zip As New ZipArchive(New DiskFile("c:\test.zip"))
Dim f As AbstractFile

For Each f In zip.GetFiles( True )
 ListBox1.Items.Add( f.FullName )
Next
Software Dev
  • 5,368
  • 5
  • 22
  • 45
  • Thanks for suggestion, but isnt it paid, and is quite expensive at that? I did look into dotnetzip but if possible i would rather not use external library. – Zabujca Apr 14 '18 at 16:15