简体   繁体   English

无法从带有PCL存储的xamarin Portable中的文件夹中读取文件

[英]Can't read files from folders in xamarin portable with PCL Storage

I'm working on a Xamarin.Forms portable project in Visual Studio. 我正在Visual Studio中的Xamarin.Forms可移植项目上工作。 I'm using the PCL storage plugin - and what should be pretty simple is driving me nuts. 我正在使用PCL存储插件-应该很简单,这简直让我发疯。 I can't access any files, not on my device and not from any folder in solution. 我无法访问任何文件,无法访问我的设备上的文件,也无法访问解决方案中的任何文件夹的文件。

I need a simple way to actually read an existing file into a stream or byte array. 我需要一种简单的方法来将现有文件实际读入流或字节数组。 How do i read from a test .mp4 file located in a folder in solution? 如何从解决方案文件夹中的.mp4测试文件中读取数据?

I've tried this: 我已经试过了:

IFile file = await FileSystem.Current.GetFileFromPathAsync("Assets/somefile.png");

Tried to access the folders from my winphone device - but all access are denied when trying to get files programmaticly. 试图从我的winphone设备访问文件夹-但是在尝试以编程方式获取文件时,所有访问都被拒绝。

I have implemented a solution for that im my shared -project. 我已经为我的共享项目实现了一个解决方案。
With a few changes, it also should work in a PCL Project. 进行一些更改后,它也应该在PCL项目中工作。 Load images from resources (shared project) 从资源加载图像(共享项目)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Xamarin中创建PCL时,.Net可移植子集中缺少HttpClient - HttpClient missing from .Net portable subset while creating PCL in Xamarin Xamarin便携式库PCL预处理程序平台 - Xamarin Portable Library PCL Preprocessor Platform 如何在Xamarin Studio中使用WCF服务在带有可移植类库(PCL)的本机应用程序中登录 - How can I consume wcf service for login in Native apps with Portable class library (PCL) in xamarin studio 使用xamarin的目录类未显示在可移植类库(PCL)中 - Directory class not showing up in portable class library (PCL) using xamarin 在Xamarin Forms可移植类库(PCL)中使用SOAP Web服务 - Consuming SOAP web service in Xamarin Forms Portable Class Library (PCL) 将Azure表存储引用到可移植类库(PCL)中 - Reference Azure Table Storage into a Portable Class Library (PCL) Xamarin PCL库和Sqlite数据存储 - Xamarin PCL library and Sqlite data storage 来自 PCL 的 Xamarin WebAPI 调用 - Xamarin WebAPI call from PCL 如何从Xamarin PCL项目通过IOT集线器将文件上传到Azure Blob存储 - How to upload a file to azure Blob storage through IOT hub from a Xamarin PCL project 如何从Xamarin Android中的本地存储读取数据? - How to read from local storage in xamarin android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM