前端之家收集整理的这篇文章主要介绍了
getJson 之 类,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008,12,28);
product.Price = 3.99M;
product.Sizes = new string[] { "Small","Medium",21)">"Large" };
string json = JavaScriptConvert.SerializeObject(product);
//{
// "Name": "Apple",
// "Expiry": new Date(1230422400000),255)">// "Price": 3.99,255)">// "Sizes": [
// "Small",255)">// "Medium",255)">// "Large"
// ]
//}
Product deserializedProduct = JavaScriptConvert.DeserializeObject<Product>(json);
原文链接:https://www.f2er.com/json/290670.html