JSON  转化为LIST

JSON  转化为LIST

string text = System.IO.File.ReadAllText("./temp/SPCConfig.json");
                List<SPCConfigEntityInfo> all = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SPCConfigEntityInfo>>(text);


   public class SPCConfigEntityInfo
    {
        public int SPCID { get; set; }
        public string Name { get; set; }
        public string FilePath { get; set; }
        public bool AllowSkip { get; set; }
        public bool Skip { get; set; }
        public bool ReadByPLC { get; set; }
        public List<SPCParameter> Parameters { get; set; }

    }

 

 

 

 public class SPCParameter
    {
        public float UpperLimit { get; set; }
        public float LowLimit { get; set; }
        public float BaseValue { get; set; }
        public int[] Pos { get; set; }
        public int SortGroup { get; set; }
        public List<string> SortNr { get; set; }
    }

 

[{"SPCID":14,"Name":"涂胶称重","FilePath":"C:\\Users\\IPC\\Documents\\MahrResult\\F3180300747.txt","AllowSkip":false,"Skip":false,"ReadByPLC":false,"Parameters":[{"UpperLimit":100.0,"LowLimit":0.0,"BaseValue":0.0,"Pos":[1],"SortGroup":1,"SortNr":["00001","01201","01202","01203","01204","01205","01206","01207","01510"]},{"UpperLimit":100.0,"LowLimit":0.0,"BaseValue":0.0,"Pos":[1],"SortGroup":2,"SortNr":["01503","01508","01517","01518","01520"]}]},{"SPCID":14,"Name":"涂胶称重","FilePath":"C:\\Users\\IPC\\Documents\\MahrResult\\F3180300748.txt","AllowSkip":false,"Skip":false,"ReadByPLC":false,"Parameters":[{"UpperLimit":100.0,"LowLimit":0.0,"BaseValue":0.0,"Pos":[1],"SortGroup":1,"SortNr":["00001","01201","01202","01203","01204","01205","01206","01207","01510"]},{"UpperLimit":100.0,"LowLimit":0.0,"BaseValue":0.0,"Pos":[1],"SortGroup":1,"SortNr":["00001","01201","01202","01203","01204","01205","01206","01207","01510"]}]}]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值