Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题是 JSON 格式如下:
{"think":{"median":1.24531,"test":6.2342}}
这就是服务器输出的样子,当我尝试解析它时,我得到错误,因为值不在引号内。
它们是双打的,不应该在引号内。这有效:
var str = @"{""think"":{""median"":1.24531,""test"":6.2342}}"; dynamic dyn = JsonConvert.DeserializeObject(str); Console.WriteLine((double)dyn.think.median);