StreamReader(string) does not exist in .NET 4.5 fo

2020-04-02 09:08发布

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

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

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

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

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

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

1条回答
不美不萌又怎样
2楼-- · 2020-04-02 09:26

"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

查看更多
登录 后发表回答