StreamReader的(字符串)无法在.NET 4.5新城存在时,它应该是? [英] StreamReader(string) does not exist in .NET 4.5 for Metro when it is supposed to?

查看:165
本文介绍了StreamReader的(字符串)无法在.NET 4.5新城存在时,它应该是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据:<一href="http://msdn.microsoft.com/en-us/library/windows/apps/system.io.streamreader.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/system.io.streamreader.aspx

和<一href="http://msdn.microsoft.com/en-us/library/windows/apps/f2ke0fzy.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/f2ke0fzy.aspx

证明,这是.NET地铁参考:<一href="http://msdn.microsoft.com/en-us/library/windows/apps/br230232.aspx">http://msdn.microsoft.com/en-us/library/windows/apps/br230232.aspx

Proof that this is the .NET for Metro Reference: http://msdn.microsoft.com/en-us/library/windows/apps/br230232.aspx

有一个构造函数用于指定文件路径。然而,在对象Broswer和放大器;在元数据不存在

There is a constructor for specifying a file path. Yet in Object Broswer & in the meta data it does not exist.

和显然是所有.NET地铁东西在引用中引用标签。

And apparently all .NET for Metro things are referenced in the References Tab.

我只是试图从项目文件夹,仅此而已访问一个txt文件。如果任何人有一个替代我所有的耳朵。

I am simply trying to access a txt file from the Project Folder, nothing more. If anyone has an alternative I am all ears.

推荐答案

这是在WinRT中的根本性变化之一。你不能只写一个文件,任何你想要的了,你必须使用独立存储。而你需要使用异步I / O与等待的关键字。

"This is one of the fundamental changes in WinRT. You can't just write a file anywhere you want anymore, you have to use isolated storage. And you need to use asynchronous I/O with the await keyword."

这个链接应该为您提供有关如何访问项目文件夹中的文件的必要信息。这里是链接:

This link should provide you with the necessary information on how to access files in your project folder. Here is the link:

的http:// blog.jerrynixon.com/2012/06/windows-8-how-to-read-files-in-winrt.html

这篇关于StreamReader的(字符串)无法在.NET 4.5新城存在时,它应该是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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