将图像保存在给定绝对URL的隔离存储中。 [英] save image in isolated storage from given absolute url.

查看:58
本文介绍了将图像保存在给定绝对URL的隔离存储中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是Windows Phone 7应用程序开发的新手。我正在尝试在独立存储中创建一个文件夹,并存储来自网络的近160个不同货币图像,其Url保存在我的应用程序数据库中。我的问题是当用户第一次登录时,从应用程序数据库中选择
所有网址并从这些网址下载图像并为隔离存储中的每个下载图像制作文件,尽管我们可以在需要时从隔离存储中选择图像。不需要每次从给定的Url下载图像。请指导
我实现它。请提供给我的代码。我在google上尝试了很多解决方案,但无法解决我的问题。请帮助我。



提前完成。

解决方案


从互联网上缓存常用事物的能力是一个非常重要的主题。 / p>

您可以创建一个Dictionary对象,并在内存和隔离存储之间对其进行序列化/反序列化。密钥可以是互联网URL,对象可以引用任何内容,例如包含Iso存储中的路径的字符串到图像。 在
外出浏览特定URL之前,请检查字典。如果您获得了点击,请阅读该文件而不是浏览。如果没有命中,请继续浏览到该文件,下载该文件,将其添加到Iso Storage,然后将其添加到Dictionary中。 Iso Storage中的文件
的名称可能是随机的,例如guid,或者它可能是包含唯一升序号码的文件名,因此它是唯一的。


除了收到此论坛的评论之外,我建议您将问题转发给One Code团队

此处
,他们将考虑编写和发布示例代码。  提及数据缓存是一项重要需求,以便优化手机性能和用户体验。


最好的问候,

Mark


Hi all, i am new in windows phone 7 apps development.I am trying to create a folder in isolated storage and store almost 160 diffirent currency images from web whose Url are saved in my application database. My problem is when user login first time, select all the url from apps database and download images from those url and make file for every downloaded images in isolated storage though we can pick images from isolated storage whenever required.No need to download images every time from given Url. Pls guide me to achieve it. Please provide me code for it . I tried much on google to find solution but unable to solve my problem.pls help me.

Thanx in advance.

解决方案

Hi,

The ability to cache frequently used things from the internet is a topic that is important.

You could create a Dictionary object, and serialize/deserialize it between memory and Isolated Storage. The key could be an internet URL, and the object could reference anything, such as a string containing the path in Iso Storage to an image.  Before going out to browse to a particular URL, check the dictionary. If you get a hit, read the file instead of browsing. If you don't get a hit, proceed to browse to the file, download it, add it to Iso Storage, and add it to the Dictionary. The name of the file in Iso Storage could be something random such as a guid, or it could be a file name containing a unique ascending number in it, so it is unique.

In addition to receiving comments from this forum I recommend you forward your question to the One Code team here, who will consider writing and publishing sample code.  Mention that data caching is an important need, in order to optimize phone performance and the user experience.

Best Regards,
Mark


这篇关于将图像保存在给定绝对URL的隔离存储中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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