示例#1
0
文件: JSON.cs 项目: nhtera/CrowdCMS
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static JSONRpcCall ParseRPC(TextReader reader)
        {
            JSONRpcCall call = new JSONRpcCall();
            object obj = ParseJSON(reader);
            Hashtable jsonRpc = (Hashtable) obj;

            call.Method = (string) jsonRpc["method"];
            call.Id = (string) jsonRpc["id"];
            call.Args = (Hashtable) ((ArrayList) jsonRpc["params"])[0];

            return call;
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static JSONRpcCall ParseRPC(TextReader reader)
        {
            JSONRpcCall call    = new JSONRpcCall();
            object      obj     = ParseJSON(reader);
            Hashtable   jsonRpc = (Hashtable)obj;

            call.Method = (string)jsonRpc["method"];
            call.Id     = (string)jsonRpc["id"];
            call.Args   = (Hashtable)((ArrayList)jsonRpc["params"])[0];

            return(call);
        }