//string 转 泛型类 string styleValue = "[{'Text':'蓝色列表','Value':'D_Default'},{'Text':'详情页','Value':'D_Detail'}]"; JavaScriptSerializer Serializers = new JavaScriptSerializer(); List<Select> sv = new List<Select>(); sv = Serializers.Deserialize<List<Select>>(styleValue); //string 转json JObject jo = (JObject)JsonConvert.DeserializeObject(styleValue);
public class Select { private string _Text; private string _Value; public string Text { get => _Text; set => _Text = value; } public string Value { get => _Value; set => _Value = value; } }