I am creating a JSONP service where I am storing data object in a JSON file after processing. So, I need to read it first from the server and Write it again.
I have done most of the code but I am not sure if following code will work or not?
String FilePath = HttpContext.Current.Server.MapPath("./RunReport.JSON");
StreamReader reader;
string strJSONdata = "";
try
{
if (File.Exists(FilePath))
{
reader = new StreamReader(FilePath);
strJSONdata = reader.ReadToEnd();
reader.Dispose();
}
}
catch (Exception ex) { }