我有以下文件格式化的Json如何閱讀JSON文件?
{
"Id": 0,
"MsgId": 125,
"ExceptionDetails": "whatever2"
}
{
"Id": 1,
"MsgId": 135,
"ExceptionDetails": "whatever2"
}
這就是它是如何在沒有括號的文件。
我需要在這個例子來分析這個文本文件,並把這些鍵的值,比如我需要得到0和1
感謝
,這是它是如何得到寫入該文件,所以可能我沒有寫入正確的JSON格式的文件
string json = JsonConvert.SerializeObject(logs, Formatting.Indented);
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\development\commonArea\WriteLines.txt", true))
{
file.WriteLine(json);
}
你的標籤包含答案:谷歌的json.net – Blorgbeard