我正在开发 Windows Phone 8.1 Silverlight 应用程序,
我正在尝试从我的 SD 卡上传文档但收到此错误。
Access is denied. Exception from HRESULT: 0x80070005
System.UnauthorizedAccessException
我还在 WMAppManifest 文件中添加了功能“ID_CAP_REMOVABLE_STORAGE”。但是没有用。
请参阅下面的代码:
private async void UploadDocument()
{
StorageFolder externalDevices = KnownFolders.RemovableDevices;
StorageFolder sdCard = (await externalDevices.GetFoldersAsync()).FirstOrDefault();
if (sdCard != null)
{
//An SD card is present and the sdCard variable now contains a reference to it
}
else
{
// No SD card is present.
}
}