Hai guys,

How can I make my application to extract files inside .rar/zip archive in application.startupPath directory!?


Recommended Answers

All 2 Replies

For zip files, I would use the DotNetZip library on CodePlex.
I have had a lot of success with it.

Imports Shell32 'Add Shell32 to reference 
Public Class Form1
    Public sc As Shell32.Shell 'Declare Shell32
Public Function ExtractFiles() As Boolean
           sc = New Shell32.Shell
           Dim DestinationFlder As Shell32.Folder = sc.NameSpace("C:\")
           Dim SourceFolder As Shell32.Folder = sc.NameSpace _
           (Application.StartupPath & "\myzipfile.zip")
           DestinationFlder.CopyHere(SourceFolder)'CopyHere is replaceable by CutHere
        Catch ignore As Exception
           Return False
        End Try
        Return True
    End Function
End Class


It's really hard to find the right answer if you don't know the right question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.