项目中引用:System.Web.Extensions
use System.Web.Script.Serialization
一维json
string str = "{\"ack\":1,\"data\":\"1.2.1\"} "
JavaScriptSerializer serializer = new JavaScriptSerializer();
dynamic info = serializer.DeserializeObject(str);
string result = info["data"].Trim();
二维json
string str = "{\"ack\":1,\"data\":[{\"store_name\":\"lux-ea\",\"url\":\"image.lux.com\"},{\"store_name\":\"yij-an\",\"url\":\"yij-an.yij.top\"}]}";
JavaScriptSerializer serializer = new JavaScriptSerializer();
dynamic storeList = serializer.DeserializeObject(amazonStoreHtml);
object[] amazonStoreList = storeList["data"];
foreach(dynamic storeInfo in amazonStoreList)
{
//取数 storeInfo["store_name"]
}