what is function in v1.9 for AddFileStream

Mar 10, 2010 at 1:28 PM
Edited Mar 10, 2010 at 1:36 PM


here is one of breaking changes from v1.8 to v1.9:

All the interfaces marked Obsolete in v1.8 have been removed. These include: the methods on the ZipFile class: AddFileFromStream(), AddFileStream() UpdateFileStream(), AddFileFromString(), all the Extract() methods that accept an entry name, and the ExtractAll() method that accepts a boolean; on the ZipEntry class, the Extract() methods that accept a Boolean, and the OverwriteOnExtract property, as well as the SetNtfsTimes() method.

I would like to know the alternative code for this function.

thank you very much!

Mar 10, 2010 at 10:47 PM

Hi, thanks for the question.

For all of the AddFileFrom*** or or UpdateFile****, use AddEntry().  There are overloads for every case that was supported in the past.

For the ZipFile.Extract(entryName)  methods, use ZipEntry.Extract().

For the ZipEntry.Extract() methods that accept a boolean, use the ZipEntry.Extract() method that accepts a ExtractExistingFileAction argument.  now, in addition to "overwrite" or "throw exception", you have other options including:  "Don't overwrite" and "call the application to ask".  

The ZipEntry.SetNtfsTimes() method is now ZipEntry.SetEntryTimes().