StreamReader(string) 在 .NET 4.5 for Metro 中应该存在时不存在吗?不存在、存在、NET、string

2023-09-06 14:21:22 作者:今日一组仙气又可爱的六字与小伙伴们分享啦,一起来看看有没有你

根据:http://msdn.microsoft.com/en-us/library/windows/apps/system.io.streamreader.aspx

并且:http://msdn.microsoft.com/en-us/library/windows/apps/f2ke0fzy.aspx

证明这是用于 Metro 参考的 .NET: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

有一个用于指定文件路径的构造函数.然而在 Object Broswer &在元数据中它不存在.

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

显然所有 .NET for Metro 的东西都在参考"选项卡中引用.

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 的根本变化之一.你不能再在任何你想写的地方写一个文件,你必须使用隔离存储.而且你需要使用带有 await 关键字的异步 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

 
精彩推荐
图片推荐