So, I created a notepad and I'm reading it through System.IO
and I'm reading the file with Json
, however it presents this error whenever I execute, what do I do?
Json
{
'barreiras':
[
{
'Linhaorg':1,
'colunaorg':1,
'altura':2,
'largura':1
},
{
'Linhaorg':6,
'colunaorg':3,
'altura':1,
'largura':2
}
]
}
Code
System.IO.StreamReader file = new System.IO.StreamReader(@"pasta do arquivo");
string f = file.ReadLine();
file.Close();
dynamic stuff = JsonConvert.DeserializeObject(f);
int linhaa = stuff.barreiras.Linhaorg;
int colunaa = stuff.barreiras.colunaorg;