C# .NET - Is there any JSonObject class that is similar to the JSONObject in java

Asked By kris kumar on 14-Nov-09 01:30 AM
org.json.JSONObject;

Is there any similar object in c#? I need to convert some java code in c# and all the java classes extends from the jsonobject. please let me know. thanks

public class JExpression extends JSONObject implements JSONExprConstants {
    //JSONArray operators;
   
    public JExpression() {
        super();
    }
   
    public JExpression(String str) throws JSONException {
        //Deserialize:
        super(str);
    }
   
    public void setOperator(JOperator operator) {
        try {
            this.put(J_E_OPERATOROBJ, operator);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
   
    public JOperator getOperator() {
        try {
           return (JOperator) this.get(J_E_OPERATOROBJ);
        } catch (JSONException e) {
            e.printStackTrace();
            return null;
        }
    }
   
}

I think what you need is JSON.Net - [)ia6l0 iii replied to kris kumar on 14-Nov-09 12:42 PM

http://james.newtonking.com/archive/2006/06/26/Json.NET-_2D00_-Simplifying-.NET-_3C002D003E00_-JavaScript-communication.aspx's an article on the Javascript Object Notation and working with it in .Net. And also the Asp.Net Ajax extension in .Net add few JSON serializers too.

Hope this helps.