如何在C#中读取JSON响应 [英] How to read JSON response in c#

查看:92
本文介绍了如何在C#中读取JSON响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用第三方服务给我坐标,以下是我想在某种对象中使用c#.net读取此内容的响应,以便我可以使用这些信息,但对如何实现此方法感到困惑.

I am using thirparty service to give me coordinates, below is the response I want to read this using c# .net in some kind of object so that I can use the information but confused how to achieve this..

{"found": 1, "bounds": [[52.45401, -1.96211], [52.45401, -1.96211]], "features": [{"id": 65140,"centroid": {"type":"POINT","coordinates":[52.45401, -1.96211]},"bounds": [[52.45401, -1.96211], [52.45401, -1.96211]],"properties": {"name": "B17 0SL"},"type": "Feature"}], "type": "FeatureCollection", "crs": {"type": "EPSG", "properties": {"code": 4326, "coordinate_order": [0, 1]}}}

谢谢

推荐答案

看看Newtonsoft.Json是一个软件包,它将为您反序列化Json成为一个类.

have a look at Newtonsoft.Json its a package that will deserialize the Json into a class for you.

,但是您将需要创建要使用的类结构.

but you will need to create the class structure you want to use.

这篇关于如何在C#中读取JSON响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆