How can I create Dictionary Type of Object from JSON type of string

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.


-------------Problems Reply------------

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!!

Class deserialize<Class>(string jsonStr, Class obj) { /* ... */}

var jstring = "{fname='Test', lname='test, oth='test'}";
var p = deserialize(jstring, new {fname="",lname=""});
var x = person.fname; //strongly-typed

Category:string Views:0 Time:2011-02-08

Related post

Copyright (C), All Rights Reserved.

processed in 0.157 (s). 11 q(s)