在asp.net中反序列化Json数据
我有一些 json 数据,我想将其转换为纯文本,下面是我在 JSON 中获取的内容
{"items":[{"id":1371503932001,"name":"shure_ksm_mics","adKeys":null,"shortDescription":"shure_ksm_mics","longDescription":null,"creationDate":"1325934831982","publishedDate":"1325934831982","lastModifiedDate":"1325937858839","linkURL":null,"linkText":null,"tags":[],"videoStillURL":null,"thumbnailURL":null,"referenceId":null,"length":204130,"economics":"AD_SUPPORTED","playsTotal":null,"playsTrailingWeek":null,"FLVURL":"rtmp:\/\/brightcove.fcod.llnwd.net\/a500\/d19\/&media\/13421268001\/13421268001_1371835938001_shure-ksm-mics&1325955600000&1818a465ec2632081e214f18376d6a4d","renditions":[],"FLVFullLength":{"audioOnly":false,"controllerType":"DEFAULT","displayName":"shure_ksm_mics.flv","encodingRate":1000000,"frameHeight":480,"frameWidth":640,"id":1371835938001,"referenceId":null,"remoteStreamName":null,"remoteUrl":null,"size":29068243,"uploadTimestampMillis":1325934831973,"url":"rtmp:\/\/brightcove.fcod.llnwd.net\/a500\/d19\/&media\/13421268001\/13421268001_1371835938001_shure-ksm-mics&1325955600000&1818a465ec2632081e214f18376d6a4d","videoCodec":"ON2","videoContainer":"FLV","videoDuration":204130},"videoFullLength":{"audioOnly":false,"controllerType":"DEFAULT","displayName":"shure_ksm_mics.flv","encodingRate":1000000,"frameHeight":480,"frameWidth":640,"id":1371835938001,"referenceId":null,"remoteStreamName":null,"remoteUrl":null,"size":29068243,"uploadTimestampMillis":1325934831973,"url":"rtmp:\/\/brightcove.fcod.llnwd.net\/a500\/d19\/&media\/13421268001\/13421268001_1371835938001_shure-ksm-mics&1325955600000&1818a465ec2632081e214f18376d6a4d","videoCodec":"ON2","videoContainer":"FLV","videoDuration":204130}}],"page_number":0,"page_size":100,"total_count":-1}
我已经创建了下面的类,
public class VideoList
{
public VideoList() { }
private string _name;
public string Name
{
get
{
return _name;
}
set
{
value = _name;
}
}
}
目前我只想获取名称。 如何使用 System.Web.Script.Serialization.JavacriptSerializer 类来做到这一点。
i have some json data, and i want to convert it into plain text, below is the content i am getting in JSON
{"items":[{"id":1371503932001,"name":"shure_ksm_mics","adKeys":null,"shortDescription":"shure_ksm_mics","longDescription":null,"creationDate":"1325934831982","publishedDate":"1325934831982","lastModifiedDate":"1325937858839","linkURL":null,"linkText":null,"tags":[],"videoStillURL":null,"thumbnailURL":null,"referenceId":null,"length":204130,"economics":"AD_SUPPORTED","playsTotal":null,"playsTrailingWeek":null,"FLVURL":"rtmp:\/\/brightcove.fcod.llnwd.net\/a500\/d19\/&media\/13421268001\/13421268001_1371835938001_shure-ksm-mics&1325955600000&1818a465ec2632081e214f18376d6a4d","renditions":[],"FLVFullLength":{"audioOnly":false,"controllerType":"DEFAULT","displayName":"shure_ksm_mics.flv","encodingRate":1000000,"frameHeight":480,"frameWidth":640,"id":1371835938001,"referenceId":null,"remoteStreamName":null,"remoteUrl":null,"size":29068243,"uploadTimestampMillis":1325934831973,"url":"rtmp:\/\/brightcove.fcod.llnwd.net\/a500\/d19\/&media\/13421268001\/13421268001_1371835938001_shure-ksm-mics&1325955600000&1818a465ec2632081e214f18376d6a4d","videoCodec":"ON2","videoContainer":"FLV","videoDuration":204130},"videoFullLength":{"audioOnly":false,"controllerType":"DEFAULT","displayName":"shure_ksm_mics.flv","encodingRate":1000000,"frameHeight":480,"frameWidth":640,"id":1371835938001,"referenceId":null,"remoteStreamName":null,"remoteUrl":null,"size":29068243,"uploadTimestampMillis":1325934831973,"url":"rtmp:\/\/brightcove.fcod.llnwd.net\/a500\/d19\/&media\/13421268001\/13421268001_1371835938001_shure-ksm-mics&1325955600000&1818a465ec2632081e214f18376d6a4d","videoCodec":"ON2","videoContainer":"FLV","videoDuration":204130}}],"page_number":0,"page_size":100,"total_count":-1}
i have created below class
public class VideoList
{
public VideoList() { }
private string _name;
public string Name
{
get
{
return _name;
}
set
{
value = _name;
}
}
}
currently i just want to get name.
how can do this using System.Web.Script.Serialization.JavacriptSerializer class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经更改了模型结构,但这应该有效:
I have changed model structure, but this should work: