How can i archive the folder with path included ?

Jan 20, 2011 at 9:58 PM
Edited Jan 20, 2011 at 10:03 PM

Hello

I encounter something strange. After a folder is ziped, when i want to unzip it the archive contains only the content of the folder. I would like to arhive entire path like ionic does when it comes about files.

How can i archive the folder with path included ?

 

This is my code :

Imports Ionic.Zip
Imports System.Net.Mail
Imports System.IO

Module subrutine
 
Dim numeArhiva As String = System.AppDomain.CurrentDomain.BaseDirectory() & Date.Today & ".zip"
Public Sub zip()
          
                Using zip As ZipFile = New ZipFile()
                    zip.ZipErrorAction = ZipErrorAction.Skip

                    For Each item In index.listaFisiere.Items

                        If (System.IO.File.Exists(item)) Or (System.IO.Directory.Exists(item)) Then
                            zip.AddItem(item)
                        End If


                    Next


                    zip.Save(numeArhiva)
                    zip.Dispose()
                End Using          
    End Sub
End Module