I'm having trouble creating a StreamReader object in Windows 8 metro application. I'm trying to make it read the text file in my local directory but it keep showing me this error. Anyone has any solutions for this or any other alternative solutions?
I'm using MS Visual Studio Ultimate 2012, metro application.
Code:
int level = 1;
var fileName = string.Format(@"Mazes\level{0}.txt", level);
using (var sr = new StreamReader(fileName))
{
var l = 0;
while (!sr.EndOfStream)
{
string line = sr.ReadLine();
for (var c = 0; c < line.Length; c++)
{
mazeValues[c, l] = line[c];
if (mazeValues[c, l] == '1')
{
var glass = new Glass();
glass.SetValue(Grid.ColumnProperty, c);
glass.SetValue(Grid.RowProperty, l);
grdMaze.Children.Add(glass);
mazeGlasses[c, l] = glass;
}
}
l++;
}
}
Error showing:
The best overloaded method for 'System.IO.StreamReader.StreamReader(System.IO.Stream)' has some invalid arguements.