将文件从 Visual Studio 添加到 WP7 独立存储? [英] Adding files to WP7 isolated storage from Visual Studio?

查看:24
本文介绍了将文件从 Visual Studio 添加到 WP7 独立存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 Windows Phone 7 应用程序,我将在其中使用 bing 地图向 ATM 显示您的位置.

I'm working on an Windows Phone 7 app where I'm going to show ATM's nere your location with bing maps.

我有一个包含地址和 gps 坐标的 xml 文件.但是如何将此文件从 Visual Studio 添加到我的程序中?如果我将 BuildAction 设置为 Content 并将复制到输出目录设置为始终复制.该文件仍然不在孤立存储中.我是否必须建立一种机制来从网络下载信息?或者有其他方法吗?

I have an xml-file with addresses and gps coordinates. But how do I add this file to my program from visual studio? If I set BuildAction to Content and Copy to output directory to Copy always. The file still isn't in IsolatedStorage. Do I have to build a mechanism to download the information from the web? Or is there another way?

推荐答案

您不能在设计时直接将文件传递到隔离存储.仅在应用程序运行时.

You cannot directly pass files to the isolated storage at design time. Only when the application is running.

我仍然建议通过 Web 服务将文件传递给应用程序.主要是因为如果您最终需要更改 XML 的内容,您将需要更新应用程序.

I'd still recommend passing the file to the application through a web service. Mainly because if eventually you will need to change the contents of the XML, you will need to update the application.

我要做的只是创建一个 WCF 服务,该服务将通过简单的 HTTP 请求返回序列化数据(或现有的 XML).

What I would do is simply create a WCF service that will return serialized data (or the existing XML) via a simple HTTP request.

这篇关于将文件从 Visual Studio 添加到 WP7 独立存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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