问题描述
我想将 C# 上的文件从计算机下载到 Windows Phone 8 上的默认文件夹 Document 或 Music.如果可能,我如何获取它们?
I want to get files on C# downloaded from computer to default folders Document or Music on windows phone 8. How can i get them, if it possible?
推荐答案
这两个文件夹可供开发人员使用,如 Windows Phone 8:媒体文件访问
Those two folders are available to a developer, as described in the answer on Windows Phone 8: Media file access
歌曲和图片的api好像是MediaLibrary 根据 MSDN 上的Windows Phone 数据"页面.
The api for songs and pictures seems to beMediaLibrary according to the "Data for Windows Phone" page on MSDN.
它允许从库中添加(SaveSong、SavePicture)和删除歌曲和图片.
It allows to add (SaveSong, SavePicture) and Delete songs and pictures from the library.
要做到这一点,您需要在应用的清单中设置 Capability ID_CAP_MEDIALIB_AUDIO 和 ID_CAP_MEDIALIB_PHOTO.
To be able to do this, you need the Capability ID_CAP_MEDIALIB_AUDIO and ID_CAP_MEDIALIB_PHOTO set in the app's manifest.
可以通过 StorageFolder Api 访问文档文件夹,如 文件访问示例
The documents folder can be accessed through the StorageFolder Api as described in the File access sample
StorageFolder storageFolder = KnownFolders.DocumentsLibrary;
下载文件
从计算机下载文件是一个完全不同的问题,需要您提供更多信息:
Downloading files
To download files from a computer is an entire different question and requires some more information from your end:
- 您想如何从计算机下载文件
- 计算机是否有文件共享服务器
- 你想使用什么协议
- ...
如果您要为该计算机编写程序以将文件共享到您的手机,那么这些Windows Phone 8 网络示例 可以提供一些有关如何在 Windows Phone 8 上获取套接字、nfc、蓝牙或 http 的信息.
If you are going to write a program for that computer to share files to your phone, then these Windows Phone 8 Networking Samples can provide some information on how to get sockets, nfc, bluetooth or http going on windows phone 8.
这篇关于Windows Phone 8 获取文件夹 Music 或 Documents 中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!