解析的数据例子:

/* {"ZT_L_W":7,"ZT_L_Y":0.07,"assistWinchSpeed":31,"driver_mode":0,"headGPActive":0,"keep_head":1,"keep_pos":0,"leftGPActive":0,"leftSharkActive":0,"mainWinchSpeed":43,"rightGPActive":0,"rightSharkActive":0,"ship_id":2,"target_head":4,"target_velocity":5,"target_x":6,"target_y":7,"type":2}*/

解析的代码:

 //解析
JObject jo = (JObject)JsonConvert.DeserializeObject(msgContent);
string zone = jo["mainWinchSpeed"].ToString();
string zone_en = jo["assistWinchSpeed"].ToString();
                   
 Console.WriteLine(zone);
 Console.WriteLine("---------------------");
 Console.WriteLine(zone_en);

GitHub 加速计划 / js / json
41.72 K
6.61 K
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 个月前 )
960b763e 4 个月前
8c391e04 6 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐