コード例 #1
0
        public static string JsonToMPFormat(JArray json)
        {
            var list = new List <MPPostValue>();

            foreach (JObject jObj in json)
            {
                foreach (var j in jObj)
                {
                    var x = new MPPostValue();
                    x.Key   = j.Key;
                    x.Value = j.Value.ToString();
                    list.Add(x);
                    System.Diagnostics.Debug.WriteLine(j.Value);
                }
            }
            System.Diagnostics.Debug.WriteLine(list.ToString());
            string jsonOut = JsonConvert.SerializeObject(list);

            return(jsonOut);
        }
コード例 #2
0
        public static string JsonToMPFormat(JArray json)
        {
            var list = new List<MPPostValue>();
            foreach (JObject jObj in json)
            {
                foreach (var j in jObj)
                {
                    var x = new MPPostValue();
                    x.Key = j.Key;
                    x.Value = j.Value.ToString();
                    list.Add(x);
                    System.Diagnostics.Debug.WriteLine(j.Value);
                }

            }
            System.Diagnostics.Debug.WriteLine(list.ToString());
            string jsonOut = JsonConvert.SerializeObject(list);
            return jsonOut;
        }