2011-10-09 97 views
0

我正在寻找从url中提取zip文件。你会推荐这样做的最佳方式是什么? 基本上,我想指出我的手机应用程序到一个Zip网址,并在其中的文件进行处理。在Windows Phone上解压芒果

在此先感谢。

+0

可能重复[如何从网上下载一个GZIP文件的WindowsPhone7,把内容解压(http://stackoverflow.com/questions/5707917/how-to-download-a-gzip-file-从-网站对WindowsPhone7的-解压最内容) –

回答

0
using ICSharpCode.SharpZipLib.Zip; 

MemoryStream mem = new MemoryStream(data); 
     ZipFile zipped = null; 
     zipped = new ZipFile(mem); 
     IEnumerator enum1 = zipped.GetEnumerator(); 
    while (enum1.MoveNext()) 
     { 
      ZipEntry entry1 = (ZipEntry)enum1.Current; 
      Stream memst = zipped.GetInputStream(entry1); 
      long len = entry1.Size; 
      cmdresp = new byte[len]; 
      memst.Read(cmdresp, 0, (int)len); 
     } 
相关问题