从 Windows Phone 8 的内部存储中读取? [英] Read from internal storage in Windows Phone 8?

查看:22
本文介绍了从 Windows Phone 8 的内部存储中读取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以访问 Windows Phone 8 中的内部文件存储?我注意到有一种方法可以从 SD 卡读取文件 http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.storage(v=vs.105).aspx 但是什么关于没有 SD 卡插槽的手机,例如诺基亚 Lumia 920?

Is there a way to access the internal file storage in Windows Phone 8? I noticed that there is a way to read files from the SD card http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.storage(v=vs.105).aspx but what about the phones that don't have an SD card slot, like the Nokia Lumia 920?

推荐答案

我不确定您所说的内部存储具体指哪里,但您可以在设备上访问一些位置.

I am not sure where specifically you mean by internal storage, but there are a few locations you can access on the device.

这是可供应用访问的基本位置.这是您自己的私人位置,用于存储您可能拥有的设置或文件.

This is the bread and butter location for an app to access. It is your own private location to store settings or files that you may have.

可以通过以下方式访问:

It can be accessed with:

StorageFolder localRoot = ApplicationData.Current.LocalFolder:

这里有更多文档还有例子.

这些是应用能够存储和访问媒体数据的常见位置.访问这些需要声明您正在访问的区域的功能以及您想要查看的文件的文件关联.

These are common locations where apps are able to store and access media data. Accessing these requires declaring the capability for the area you are accessing and the file associations for the files you would like to see.

例如,获取相机胶卷文件夹需要以下内容:

For example getting the camera roll folder would require the following:

在 WMAppManifest 中:

In WMAppManifest:

<Capability Name="ID_CAP_MEDIALIB_PHOTO" /> 

C#

StorageFolder cameraRoll = KnownFolders.CameraRoll;

有更多关于 Visual Studio 设计器中不同功能的文档.(与完整的 MSDN 文章相比,那里的摘要更容易获得简要的理解.)

There is more documentation of the different capabilities in the designer in Visual Studio. (The summaries there are easier to get a brief understanding with than the full MSDN articles.)

KnownFolders 可以访问您可以在内部使用它的所有不同位置.不过请注意,有些位置是特定于 Windows 或 Phone 的,但它们都被记录在案,以便您知道是哪一个.

KnownFolders has access to all of the different locations that you can get at internally using it. Careful though, some of the locations are Windows or Phone specific, but they are all documented so you know which.

这篇关于从 Windows Phone 8 的内部存储中读取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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