LitJson中对于Json数据格式的要求
2021-03-02 11:27
标签:ogr 报错 解析 方便 cfa strong instr pre function
作者:艾孜尔江 LitJson中对于Json数据格式的要求 标签:ogr 报错 解析 方便 cfa strong instr pre function 原文地址:https://www.cnblogs.com/ezhar/p/14344368.html
{ "programmers": [
{ "firstName": "Brett", "lastName":"McLaughlin", "email": "brett@newInstance.com" },
{ "firstName": "Jason", "lastName":"Hunter", "email": "jason@servlets.com" },
{ "firstName": "Elliotte", "lastName":"Harold", "email": "elharo@macfaq.com" }
],
"authors": [
{ "firstName": "Isaac", "lastName": "Asimov", "genre": "science fiction" },
{ "firstName": "Tad", "lastName": "Williams", "genre": "fantasy" },
{ "firstName": "Frank", "lastName": "Peretti", "genre": "christian fiction" }
],
"musicians": [
{ "firstName": "Eric", "lastName": "Clapton", "instrument": "guitar" },
{ "firstName": "Sergei", "lastName": "Rachmaninoff", "instrument": "piano" }
]
}
{"ChatType":"LongChat","UserState":"Online","CallingState":"Leisure","Msg":"Other"}
function DataStruct(chatType: ChatType, userState: UserState, callingState: CallingState, msg: Msg) {
const result: string = `{
"ChatType": "`+ ChatType[chatType] + `",
"UserState": "`+ UserState[userState] + `",
"CallingState": "`+ CallingState[callingState] + `",
"Msg": "`+ Msg[msg] + `"
}`
return result;
}
JsonData jsonResult = JsonMapper.ToObject(Encoding.UTF8.GetString(data));
转载请务必标明出处!
上一篇:dnspod CURL模拟访问
文章标题:LitJson中对于Json数据格式的要求
文章链接:http://soscw.com/index.php/essay/59009.html