复制
收藏
提问
全网

#region OCV Devices.Add(new OCVModel { DeviceNumber = 1, DeviceName = "OCV0", DeviceType = EnumDeviceType.OCV0, DeviceDescription = "OCV0", DevicePLC = new OmronFinsNet("192.168.1.248", 5003), //BindLineModelCodes = new List<string>() { "G0632" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 4, }); Devices.Add(new OCVModel { DeviceNumber = 2, DeviceName = "OCV1", DeviceType = EnumDeviceType.OCV1, DeviceDescription = "OCV1", DevicePLC = new OmronFinsNet("192.168.1.248", 5005), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 11, }); Devices.Add(new OCVModel { DeviceNumber = 3, DeviceName = "OCV2", DeviceType = EnumDeviceType.OCV2, DeviceDescription = "OCV2", DevicePLC = new OmronFinsNet("192.168.1.248", 5006), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 15, }); #endregion 麻烦转换成json格式

5e33ffdff
3个月前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题#region OCV Devices.Add(new OCVModel { DeviceNumber = 1, DeviceName = "OCV0", DeviceType = EnumDeviceType.OCV0, DeviceDescription = "OCV0", DevicePLC = new OmronFinsNet("192.168.1.248", 5003), //BindLineModelCodes = new List<string>() { "G0632" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 4, }); Devices.Add(new OCVModel { DeviceNumber = 2, DeviceName = "OCV1", DeviceType = EnumDeviceType.OCV1, DeviceDescription = "OCV1", DevicePLC = new OmronFinsNet("192.168.1.248", 5005), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 11, }); Devices.Add(new OCVModel { DeviceNumber = 3, DeviceName = "OCV2", DeviceType = EnumDeviceType.OCV2, DeviceDescription = "OCV2", DevicePLC = new OmronFinsNet("192.168.1.248", 5006), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 15, }); #endregion 麻烦转换成json格式

已完成理解#region OCV Devices.Add(new OCVModel { DeviceNumber = 1, DeviceName = "OCV0", DeviceType = EnumDeviceType.OCV0, DeviceDescription = "OCV0", DevicePLC = new OmronFinsNet("192.168.1.248", 5003), //BindLineModelCodes = new List<string>() { "G0632" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 4, }); Devices.Add(new OCVModel { DeviceNumber = 2, DeviceName = "OCV1", DeviceType = EnumDeviceType.OCV1, DeviceDescription = "OCV1", DevicePLC = new OmronFinsNet("192.168.1.248", 5005), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 11, }); Devices.Add(new OCVModel { DeviceNumber = 3, DeviceName = "OCV2", DeviceType = EnumDeviceType.OCV2, DeviceDescription = "OCV2", DevicePLC = new OmronFinsNet("192.168.1.248", 5006), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 15, }); #endregion 麻烦转换成json格式

展开阅读网页

[
  {
    "DeviceNumber": 1,
    "DeviceName": "OCV0",
    "DeviceType": "OCV0",
    "DeviceDescription": "OCV0",
    "DevicePLC": {
      "Address": "192.168.1.248",
      "Port": 5003
    },
    "PLC_ProductionNo": "D100",
    "PLC_OperationMode": "D104",
    "PLC_DeviceStatus": "D106",
    "ProcessCode": 4
  },
  {
    "DeviceNumber": 2,
    "DeviceName": "OCV1",
    "DeviceType": "OCV1",
    "DeviceDescription": "OCV1",
    "DevicePLC": {
      "Address": "192.168.1.248",
      "Port": 5005
    },
    "PLC_ProductionNo": "D100",
    "PLC_OperationMode": "D104",
    "PLC_DeviceStatus": "D106",
    "ProcessCode": 11
  },
  {
    "DeviceNumber": 3,
    "DeviceName": "OCV2",
    "DeviceType": "OCV2",
    "DeviceDescription": "OCV2",
    "DevicePLC": {
      "Address": "192.168.1.248",
      "Port": 5006
    },
    "PLC_ProductionNo": "D100",
    "PLC_OperationMode": "D104",
    "PLC_DeviceStatus": "D106",
    "ProcessCode": 15
  }
]
更专业一些
转笔记
专业
#region OCV Devices.Add(new OCVModel { DeviceNumber = 1, DeviceName = "OCV0", DeviceType = EnumDeviceType.OCV0, DeviceDescription = "OCV0", DevicePLC = new OmronFinsNet("192.168.1.248", 5003), //BindLineModelCodes = new List<string>() { "G0632" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 4, }); Devices.Add(new OCVModel { DeviceNumber = 2, DeviceName = "OCV1", DeviceType = EnumDeviceType.OCV1, DeviceDescription = "OCV1", DevicePLC = new OmronFinsNet("192.168.1.248", 5005), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 11, }); Devices.Add(new OCVModel { DeviceNumber = 3, DeviceName = "OCV2", DeviceType = EnumDeviceType.OCV2, DeviceDescription = "OCV2", DevicePLC = new OmronFinsNet("192.168.1.248", 5006), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 15, }); #endregion 麻烦转换成json格式
不在提醒

更专业内容正在努力生成中
知识树
#region OCV Devices.Add(new OCVModel { DeviceNumber = 1, DeviceName = "OCV0", DeviceType = EnumDeviceType.OCV0, DeviceDescription = "OCV0", DevicePLC = new OmronFinsNet("192.168.1.248", 5003), //BindLineModelCodes = new List<string>() { "G0632" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 4, }); Devices.Add(new OCVModel { DeviceNumber = 2, DeviceName = "OCV1", DeviceType = EnumDeviceType.OCV1, DeviceDescription = "OCV1", DevicePLC = new OmronFinsNet("192.168.1.248", 5005), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 11, }); Devices.Add(new OCVModel { DeviceNumber = 3, DeviceName = "OCV2", DeviceType = EnumDeviceType.OCV2, DeviceDescription = "OCV2", DevicePLC = new OmronFinsNet("192.168.1.248", 5006), //BindLineModelCodes = new List<string>() { "G0520" }, PLC_ProductionNo = "D100", PLC_OperationMode = "D104", PLC_DeviceStatus = "D106", ProcessCode = 15, }); #endregion 麻烦转换成json格式
如何将C#代码转换为JSON格式?
OCVModel类如何序列化为JSON?
C#中如何使用Json.NET进行序列化?
在线客服