I want to read a file data.json and convert it to a string.
My code is this one:
String json = null;
using (StreamReader sr = new StreamReader("data.json"))
{
json = sr.ReadToEnd();
}
but Visual Studio tells me that StreamReader
does not expect a String as constructor argument.
How can I tell StreamReader that I want to read the file data.json?