to unzip a package, you should do something like:
using (Package package = Package.Open("yourzip.zip", FileMode.Open, FileAccess.Read))
{
foreach (PackagePart part in package.GetParts())
{
Stream input = part.GetStream();
FileStream output = new FileStream(part.Uri, FileMode.Create, FileAccess.Write);
CopyStream(input, output);
input.Close();
output.Close();
}
}
// you will need this helper method:
private static void CopyStream(Stream source, Stream target)
{
const int bufSize = 0x1000;
byte[] buf = new byte[bufSize];
int bytesRead = 0;
while ((bytesRead = source.Read(buf, 0, bufSize)) > 0)
target.Write(buf, 0, bytesRead);
}// end:CopyStream()