I failed to zip a folder

Apr 28, 2010 at 3:13 PM
hi cheeso, i try to zip a folder which it have subfolders,using your example code but it sends me an error:
'AddFiles' is not a member of 'Ionic.Zip.ZipFile'
your example code is from the documentation:
Dim ZipFileToCreate As String = "archive1.zip"
Dim DirectoryToZip As String = "c:\reports"
Using zip As ZipFile = New ZipFile()
    Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip)
    zip.AddFiles(filenames, "files")
    zip.Save(ZipFileToCreate)
End Using

perhaps it is more simple than it appears.
do you have another example code which zip a folder?
thanks.
Manuel.



        
    
Coordinator
Apr 28, 2010 at 3:57 PM
Edited Apr 28, 2010 at 3:59 PM

I just took the code you showed, and compiled it.  It works.

It could be that you have an older version, released before the AddFiles() method was introduced.  

What version of the library are you using?

Apr 28, 2010 at 4:14 PM

i'm not sure... but in vstudio it says: version of reference : 1.7.2.3

how can i change the version?

thanks.

Apr 28, 2010 at 4:19 PM

problem solved ... thanks for your time ...