Noob problem with Extract

Nov 12, 2010 at 9:53 AM

I have just downloaded the 1.9 SDK and while trying to use several of the C# examples that used the Extract(string, stream) does not seem to exist. I have the name space added and the code snippet I am trying to use is as follows:

using Ionic.Zip;
static void ZipStream(Stream _inputStream, Stream _outputStream)
{
   using (var zip = ZipFile.Read(_inputStream))
   {
      zip.Extract("NameOfEntryInArchive.doc", _outputStream);
   }
}


I am linking against/referencing the full 1.9 debug DLL. My problem is that it would seem that there is no longer an Extract method in the assembly. Currently trying to use the lib with VS2010 not sure if that is part of my problem.

Either way any help with this would be appreciated.

Thank you.

Coordinator
Nov 12, 2010 at 11:59 AM

Yes, the method has been removed.  The method you want is ZipEntry.Extract.  To retrieve an entry  by name, use the string selector.  like this:

using Ionic.Zip;
static void ZipStream(Stream _inputStream, Stream _outputStream)
{
   using (var zip = ZipFile.Read(_inputStream))
   {
      zip["NameOfEntryInArchive.doc"].Extract(_outputStream);
   }
}


Show me where you found that sample code, and I Will correct it.

 

 

Nov 12, 2010 at 10:59 PM

This was the page that I used. Very near the bottom but most of the examples that extract use the old method.

http://dotnetzip.codeplex.com/wikipage?title=CS-Examples&referringTitle=Examples

 

Thank you for your prompt response. I believe that the online documentation also uses the old method a number of times as well. I will be in and out of there so if I find more issues I will link you.

 

Nice work on the lib looking forward to using it.

Coordinator
Nov 13, 2010 at 6:29 AM

Thanks - I've looked there and found one example that uses the old method.  I've fixed it.  If you see other old example code, I'd appreciated it if you could let me know.

Also thanks for the compliments.

Good luck with the library.