Add Directory Method

Jul 5, 2011 at 3:03 PM

I am having problems with the AddDirectory Method.  I downloaded the library and looked through the reference material, the FAQs, and some of the discussions but I haven't found an exact solution to my problem.  When I use the overloaded AddDirectory method the files are added to the zip file without the root directory (directoryPathInArchive) I specify.  Has anyone else had this problem or know of a possible solution?

I am using VB .NET with a 2.0 framework

The code I use is 

Try
     Dim baseFolder as String = "D:\Users\SomeFolder"
    Using zip As ZipFile = New ZipFile
         zip.AddDirectory(baseFolder, System.IO.Path.GetFileName(baseFolder))
         zip.Save(baseFolder & ".zip")
     End Using
 Catch ex As Exception
     Msg.Box("Unable to zip files(s)")
End Try

I've even tried this, just to test if a directory was being written to the zip file

Try
    Using zip As ZipFile = New ZipFile
         zip.AddDirectoryByName("SomeFolder")
         zip.Save("SomeFolder.zip")
     End Using
 Catch ex As Exception
     Msg.Box("Unable to zip files(s)")
End Try
Jul 5, 2011 at 3:12 PM

Please disregard this post. I placed another in the DotNetZip Library discussion board.

Jul 5, 2011 at 3:12 PM

Please disregard this post. I placed another in the DotNetZip Library discussion board.