如何在Windows Phone 7中解压缩zip文件? [英] How do I extract zip file in Windows Phone 7?

查看:81
本文介绍了如何在Windows Phone 7中解压缩zip文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Windows Phone 7项目中有一个zip文件.我已将构建操作"设置为内容",并将复制到输出目录"设置为始终".压缩文件包含文件夹结构.我希望将其完全复制到电话项目"中.我为此使用SharpZipLib.这是代码:-

I have a zip file in my Windows Phone 7 project. I have set the Build Action to Content and Copy to output directory to Always. The zip file contains the folder structure. I want this to be copied entirely as it is in my Phone Project. I am using SharpZipLib for this. This is the code :-

 Stream stremInfo = Application.GetResourceStream(new Uri("xip.zip", UriKind.Relative)).Stream;



        new FastZip(). ExtractZip(stremInfo,
            "",FastZip.Overwrite.Always,null,null,null,true,true);

但是,调用ExractZip时出现错误.我得到的异常是"MethodAccessException".无法调用GetFullPath().有人可以让我知道我在想什么吗?我该怎么做才能避免这种情况?

However I get error when ExractZip is called. The exception I get is "MethodAccessException". Cannot call GetFullPath(). Can anybody let me know what am I missing? What can I do to avoid it?

推荐答案

查看此实用程序,可能会对您有所帮助.

Check out this utility, it may help you out.

http://www.sharpgis.net/post/2009/04/22/REALLY-small-unzip-utility-for-Silverlight.aspx

这篇关于如何在Windows Phone 7中解压缩zip文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆