Possible Duplicate:
How to read a text file line by line Windows RT?
I am trying to read from file line by line in C#.
This is my code
String filename = "apoel.txt";
System.IO.StreamReader file = new System.IO.StreamReader(filename);
I followed instructions from an MSDN page and followed them exactly. The problem is I keep getting the errors
The best overloaded method match for System.IO.StreamReader.StreamReader (System.IO.Stream)’ has some
invalid arguments
Argument 1: cannot convert from ‘string’ to ‘System.IO.Stream’
I added using System.IO; on the top of my code
What am I doing wrong? If it is of any help this is a Windows Metro app
Also can someone explain to me why the article from MSDN that I post is wrong and not working? Do not give me an alternative please. Please tell me why my code is not working while it is explained like that in MSDN
Here is the code i use for Reading/Writing a file in Windows 8. It works and i hope it helps you too.