I’m kinda new to WP7 platform, I’m doing something involved with the isolated storage and kinda stuck right now, it’s pretty simple, but not for me though. My app requires to download a zip-file and save to processing, I’ve done the downloading part and I can save it to an isolated storage, I use isolated storage explorer to check the status, and the file is there.
void wcMedia_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
filename1 = "book" + bookId + ".zip";
if (e.Error != null) return;
var str = e.Result;
using (var myStore = IsolatedStorageFile.GetUserStoreForApplication())
{
if (myStore.FileExists(filename1)) myStore.DeleteFile(filename1);
var buffer = new byte[1024];
using (var isoStorStr = myStore.OpenFile(filename1, FileMode.CreateNew))
{
int bytesRead = 0;
while ((bytesRead = str.Read(buffer, 0, 1024)) > 0)
isoStorStr.Write(buffer, 0, bytesRead);
}
}
Debug.WriteLine("done");
}
My problem is how to extract the zip file, my zip contains 3 more folders and some mp3 and image files. I’ve tried 3rd party libraries like: SharpZipLib, dotnetzip but no success. Can someone help me out. Thanks very much.
Don’t think this is your fault. Looks like it is stemmed from DotNetZip being compiled with an older version of .Net.
See here: http://dotnetzip.codeplex.com/workitem/14049
One comment lists a patch that may fix it for 4.0. If you change libraries instead and hit an error, post it I’ll help you get it working.