コード例 #1
0
 public static Dictionary<string, object> JSONDeserializer(string JSON)
 {
     if (JSON.StartsWith("XXX("))
     {
         JSON = JSON.Substring(4, JSON.Length - 6);
     }
     if (JSON.Equals("No Server Response"))
     {
         MessageBox.Show("Oops! We couldn't receive any data from the Internet. Try again later.", "HttpGet: Response error",
            MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
         return new Dictionary<string, object>();
     }
     _4SquareLite.JavaScriptSerializer JSONDeserializer = new _4SquareLite.JavaScriptSerializer();
      return JSONDeserializer.Deserialize(JSON);
 }
コード例 #2
0
 private static string JSONSerializer(Dictionary<string, object> DictionaryObject)
 {
     //            JsonConvert.SerializeObject JSONSerializer = new JsonConvert();
     //            return JSONSerializer.Serialize(DictionaryObject);
     _4SquareLite.JavaScriptSerializer JSONSerializer = new _4SquareLite.JavaScriptSerializer();
     return JSONSerializer.Serialize(DictionaryObject);
     //            return JsonWriter.Serialize(DictionaryObject);
 }