[英]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.