标签:类库 oid get 添加引用 字符串 base 类型 [] des
string channelGroup=[{"SpType":"1","BaseInfoId":["xxx","xxx","xxx"]},{"SpType":"2","BaseInfoId":["xxx","xxx","xxx"]},{"SpType":"3","BaseInfoId":["xxx","xxx","xxx"]}]
需要先定义两个类
public struct ConfigCode {
public string SpType { get; set; }
public string[] BaseInfoId { get; set; }
}
public class JsonData {
public List<ConfigCode> ConfigCode;
}
var tmp= Newtonsoft.Json.JsonConvert.DeserializeObject<List<ConfigCode>>(channelGroup);//处理json字符串,其中的类库需要自己添加引用Newtonsoft.Json.dll
标签:类库 oid get 添加引用 字符串 base 类型 [] des
原文地址:http://www.cnblogs.com/zwyAndDong/p/7498902.html