I have this JSON string:
string ab="{\"1\":{\"oid\":\"2892\",\"order\":\"SD1427999310502\"},\"all\":1,\"time\":\"2015-02-02 10:37:55\"}";
How can I get the oid and order value?
I have this JSON string:
string ab="{\"1\":{\"oid\":\"2892\",\"order\":\"SD1427999310502\"},\"all\":1,\"time\":\"2015-02-02 10:37:55\"}";
How can I get the oid and order value?
Include Newtonsoft.Json external DLL in your project references and use the below code.
string json_string = "{\"1\":{\"oid\":\"2892\",\"order\":\"SD1427999310502\"},
\"all\":1,\"time\":\"2015-02-02 10:37:55\"}";
JObject outer_object = JObject.Parse(json_string);
JObject inner_object = (JObject)outer_object["1"];
string oid_value = inner_object["oid"].ToString();
string order_value = inner_object["order"].ToString();