When doing the mobile side, when we need to obtain multiple files from the server, in order to save traffic, the server will generally return a compressed package, then we are the download completed, in the phone to extract to the specified location
Sharpcompress is the ability to unzip a class library (. net) in the phone, CodePlex is open source, supports desktop and mobile
Click to download the latest version view support Content API Usage Example
Let's take a look at the zip package used in the Windows Phone to unzip it
Public Async voiddownloadanduncompress () {stringstrURL ="http://qd.baidupcs.com/file/3ebe6e988584733fba61c04e9568bc73?fid=3860865449-250528-923682234289515& Time=1401003314&sign=fdtaxer-dcb740ccc5511e5e8fedcff06b081203-sdvdhrr7p1ewhmufnoaylqbwlme%3d&to=qb &fm=q,b,u,nc&newver=1&expires=1401003914&rt=sh&r=347257022&logid=3996325361&sh=1 &vuk=3860865449&fn=sharpcompress0.10.3.zip"; awaitTask.run (() ={WebClient WC=NewWebClient (); Wc. OpenReadAsync (NewUri (strURL, Urikind.absolute)); Wc. DownloadProgressChanged+ = (s, dpce) = ={System.Diagnostics.Debug.WriteLine ("has been downloaded"+ DPCE. Progresspercentage +"%"); }; Wc. Openreadcompleted+ = (s, orce) = = { if(Orce. Error! =NULL) {System.Diagnostics.Debug.WriteLine ("Download Error"); return; } using(IsolatedStorageFile storage =isolatedstoragefile.getuserstoreforapplication ()) { varziparchive = Archivefactory.open (orce. Result);//Create an decompressor foreach(varEntryinchZiparchive.entries)//extract inside each entity, including folders are counted entities { //If you first create a folder for a folder if(entry. isdirectory) {if(!storage. DirectoryExists (entry. FilePath)) {storage. CreateDirectory (entry. FilePath); } Continue; } //entry. FilePath the full path of the file using(IsolatedStorageFileStream Isofilestream =storage. CreateFile (entry. FilePath)) {//write to isolated storage spaceentry. WriteTo (Isofilestream); }} ziparchive.dispose (); System.Diagnostics.Debug.WriteLine ("Unzip complete"); } }; }); }
Others such as RAR, Tar, GZip, 7Zip can refer to CodePlex official documents