如何从 JSON 类型的字符串创建字典类型的对象
我希望从下面的字符串创建一个字典类型的对象,而不使用任何扩展类。我更喜欢编写一个 .net 类来对其进行序列化和反序列化。
string userDetails = "{"FullName":"Manoj Singh","username":"Manoj","Miles":2220,"TierStatus":"Gold","TierMiles":23230,"MilesExpiry":12223,"ExpiryDate":"31 January 2011","PersonID":232323,"AccessToken":"sfs23232s232","ActiveCardNo":"232323223"}";
我的结果中有上面的字符串,现在我想使用 .NET 2.0 将其转换为对象的字典类型。
谢谢。
I am looking to create a dictionary type of object from below string without using any extension class. I would prefer to write a .net class which will do serialize and deserialize it.
string userDetails = "{"FullName":"Manoj Singh","username":"Manoj","Miles":2220,"TierStatus":"Gold","TierMiles":23230,"MilesExpiry":12223,"ExpiryDate":"31 January 2011","PersonID":232323,"AccessToken":"sfs23232s232","ActiveCardNo":"232323223"}";
I have got above string in my results, now I want to convert it into dictionary type of Object using .NET 2.0.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我等了很多天才得到任何回应,不幸的是没有回应,好吧,我在这个问题的帮助下解决了我的问题你能在.NET中从JSON实例化一个对象实例吗?
感谢所有看到这个问题的人!
I was waiting since many days to have any response on it, unfortunately there were no response, well guys I resolved my problem with the help of this question Can you Instantiate an Object Instance from JSON in .NET?
Thanks to all you who have seen this question!
试试这个!
try this!!