如何去除json [英] How to deserilize json

查看:96
本文介绍了如何去除json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,任何人都可以帮我解决下面给出的json





{

Inspir :[

{

Id:1,

引用:我们就是我们的想法。我们所有的一切都来自于我们的想法。凭借我们的想法,我们创造了世界。,

演讲者:ABC

},

{

Id:2,

引用:当你意识到一切都很完美时,你会向后倾斜,嘲笑天空。,
演讲者:XYZ

},

{

Id:3,

引用:宇宙中只有一个角落你可以肯定会改进,那就是你自己。,

演讲者:PQR

},



]

}

Hi can anyone help me in desirilizing the below given json


{
"Inspir": [
{
"Id": 1,
"Quote": "We are what we think. All that we are arises with our thoughts. With our thoughts, we make the world.",
"Speaker": "ABC"
},
{
"Id": 2,
"Quote": "When you realize how perfect everything is, you will tilt your head back and laugh at the sky.",
"Speaker": "XYZ"
},
{
"Id": 3,
"Quote": "There's only one corner of the universe you can be certain of improving, and that's your own self.",
"Speaker": "PQR"
},

]
}

推荐答案

使用哪种语言你是你吗?唱?对于Javascript,您可以使用

JSON.parse(json_string);
which language are you using? For Javascript, you can use
JSON.parse( json_string );


请检查以下链接。我认为它会对您有所帮助。



http://stackoverflow.com / questions / 7203770 / how-to-deserialize-json-in-asp-net [ ^ ]



谢谢,

Bilaal
Please check the below link.I think it will help you.

http://stackoverflow.com/questions/7203770/how-to-deserialize-json-in-asp-net[^]

Thanks,
Bilaal


将您的json复制到json2csharp.com,它为您的应用程序生成类,然后在您的应用程序中使用此类。

反序列化使用命名空间newtonsoft.json



将您的反序列化json存储在var中



var object = jsonconvert..DeserializeObject< your class = >(您正在使用的事件)
copy your json to json2csharp.com, it generate class for your app and then you use this class in your app.
to deserialize use namespace newtonsoft.json

store your deserialize json in var like

var object = jsonconvert..DeserializeObject<your class="">(event which you are using)


这篇关于如何去除json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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