//需要安装 Microsoft.Extensions.Configuration;
//Microsoft.Extensions.Configuration.json
//Microsoft.Extensions.Configuration.xml
//Microsoft.Extensions.Configuration.Binder;
//注意: json 的key中不能出现冒号":"
//XML的 Atrribute中不能出现关键词 “Name”, 且不能使用根节点(从第一个子节点开始)
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//需要安装 Microsoft.Extensions.Configuration;
//Microsoft.Extensions.Configuration.json
//Microsoft.Extensions.Configuration.xml
//Microsoft.Extensions.Configuration.Binder;
//注意: json 的key中不能出现冒号":"
//XML的 Atrribute中不能出现关键词 "Name", 且不能使用根节点(从第一个子节点开始)
namespace XMLFrameworkDemon
{
internal class Program
{
static void Main(string[] args)
{
ConfigurationBuilder cfgbuilder = new ConfigurationBuilder();
cfgbuilder.AddXmlFile("cfg.xml");
IConfigurationRoot root = cfgbuilder.Build(); ;
string name = root.GetSection("NodeClass:ModbusNode:ModbusGroup:NameXML").Value;
//string variable = root.GetSection("NodeClass:ModbusNode:Variable:0:NameXML").Value; //不行
ConfigurationBuilder cfgJsonbuilder = new ConfigurationBuilder();
cfgJsonbuilder.AddJsonFile("VariableNode.json");
IConfigurationRoot rootJson = cfgJsonbuilder.Build();
string nameJson = rootJson.GetSection("NodeClass:ModbusNode:ModbusGroup:Name").Value;
Console.WriteLine("=======XML===========");
Console.WriteLine(name);
Console.WriteLine("========Json==========");
Console.WriteLine(nameJson);
Console.WriteLine(" ");
Console.WriteLine("=======使用extensions.Configuration.Binder获取变量===========");
Console.WriteLine(" ");
Variable variablexml = root.GetSection("NodeClass:ModbusNode:ModbusGroup:Variable:2").Get<Variable>();
VariableJson variableJson = rootJson.GetSection("NodeClass:ModbusNode:ModbusGroup:Variable:1").Get<VariableJson>();
Console.WriteLine("======XML============");
Console.WriteLine(variablexml.NameXML);
Console.WriteLine("=======Json===========");
Console.WriteLine(variableJson.Description);
Console.ReadKey();
//结果:
/*
=======XML===========
测试1: 长度为寄存器个数
========Json==========
保持寄存器长度为寄存器个数
=======使用extensions.Configuration.Binder获取变量===========
======XML============
Float3
=======Json===========
40003-40004
*/
}
}
}
//结果:
/*
=======XML===========
测试1: 长度为寄存器个数
========Json==========
保持寄存器长度为寄存器个数
=======使用extensions.Configuration.Binder获取变量===========
======XML============
Float3
=======Json===========
40003-40004
*/
实体类:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace XMLFrameworkDemon
{
public class Variable
{
public string NameXML { get; set; }
public string Description { get; set; }
public string Type { get; set; }
public string VarAddress { get; set; }
public string Scale { get; set; }
public string Offset { get; set; }
public string Start { get; set; }
public string AccessProperty { get; set; }
public string AlarmEnable { get; set; }
public string ArchiveEnable { get; set; }
public string SetLimitEnable { get; set; }
public string AlarmType { get; set; }
public string DiscreteAlarmType { get; set; }
public string DiscreteAlarmNote { get; set; }
public string LoLoAlarmEnable { get; set; }
public string LoLoAlarmValue { get; set; }
public string LoLoAlarmPriority { get; set; }
public string LoLoAlarmNote { get; set; }
public string LowAlarmEnable { get; set; }
public string LowAlarmValue { get; set; }
public string LowAlarmPriority { get; set; }
public string LowAlarmNote { get; set; }
public string HighAlarmEnable { get; set; }
public string HighAlarmValue { get; set; }
public string HighAlarmPriority { get; set; }
public string HighAlarmNote { get; set; }
public string HiHiAlarmEnable { get; set; }
public string HiHiAlarmValue { get; set; }
public string HiHiAlarmPriority { get; set; }
public string HiHiAlarmNote { get; set; }
public string ArchivePeriod { get; set; }
public string SetLimitMax { get; set; }
public string SetLimitMin { get; set; }
public string VarType { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace XMLFrameworkDemon
{
public class VariableJson
{
public long Id { get; set; }
public string Number { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Type { get; set; }
public string VarAddress { get; set; }
public string Scale { get; set; }
public string Offset { get; set; }
public string Start { get; set; }
public string AccessProperty { get; set; }
public string AlarmEnable { get; set; }
public string ArchiveEnable { get; set; }
public string SetLimitEnable { get; set; }
public string AlarmType { get; set; }
public string DiscreteAlarmType { get; set; }
public string DiscreteAlarmPriority { get; set; }
public string DiscreteAlarmNote { get; set; }
public string LoLoAlarmEnable { get; set; }
public string LoLoAlarmValue { get; set; }
public string LoLoAlarmPriority { get; set; }
public string LoLoAlarmNote { get; set; }
public string LowAlarmEnable { get; set; }
public string LowAlarmValue { get; set; }
public string LowAlarmPriority { get; set; }
public string LowAlarmNote { get; set; }
public string HighAlarmEnable { get; set; }
public string HighAlarmValue { get; set; }
public string HighAlarmPriority { get; set; }
public string HighAlarmNote { get; set; }
public string HiHiAlarmEnable { get; set; }
public string HiHiAlarmValue { get; set; }
public string HiHiAlarmPriority { get; set; }
public string HiHiAlarmNote { get; set; }
public string ArchivePeriod { get; set; }
public string SetLimitMax { get; set; }
public string SetLimitMin { get; set; }
public string VarType { get; set; }
public string StoreType { get; set; }
public string InsertTime { get; set; }
public string Value { get; set; }
public long ModbusGroupId { get; set; }
}
}
XML:文章来源:https://www.toymoban.com/news/detail-509801.html
<Settings>
<NodeClass NameXML="Modbus客户端" Description="Modbus相关客户端">
<ModbusNode NameXML="Modbus TCP Client" Description="1#ZG上位机测试" ModbusType="2000" ConnectTimeOut="2000" CreateTime="2022-03-07 21:18:29" ReConnectTime="5000" InstallationDate="2022-03-07 21:18:29" IsActive="True" MaxErrorTimes="1" KeyWay="VarName" UseAlarmCheck="True" ServerURL="127.0.0.1" Port="502" DataFormat="ABCD">
<ModbusGroup NameXML="测试1: 长度为寄存器个数" Description="40000-40005" Type="ModbusTCP" StoreArea="保持寄存器" Length="9" Start="0" SlaveID="1" IsActive="true">
<Variable NameXML="Float1" Description="40001-40002" Type="ModbusTCP" VarAddress="0" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="True" SetLimitEnable="True" AlarmType="True" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="True" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="40000-40001低低报警" LowAlarmEnable="True" LowAlarmValue="20" LowAlarmPriority="0" LowAlarmNote="40000-40001低报警" HighAlarmEnable="True" HighAlarmValue="80" HighAlarmPriority="0" HighAlarmNote="40000-40001高报警" HiHiAlarmEnable="True" HiHiAlarmValue="100" HiHiAlarmPriority="0" HiHiAlarmNote="40000-40001高高报警" ArchivePeriod="80" SetLimitMax="100" SetLimitMin="0" VarType="Float" />
<Variable NameXML="Float2" Description="40003-40004" Type="ModbusTCP" VarAddress="2" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="True" SetLimitEnable="True" AlarmType="True" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="True" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="40002-40003低低报警" LowAlarmEnable="True" LowAlarmValue="20" LowAlarmPriority="0" LowAlarmNote="40002-40003低报警" HighAlarmEnable="True" HighAlarmValue="80" HighAlarmPriority="0" HighAlarmNote="40002-40003高报警" HiHiAlarmEnable="True" HiHiAlarmValue="100" HiHiAlarmPriority="0" HiHiAlarmNote="40002-40003高高报警" ArchivePeriod="80" SetLimitMax="100" SetLimitMin="0" VarType="Float" />
<Variable NameXML="Float3" Description="40005-40006" Type="ModbusTCP" VarAddress="4" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="True" SetLimitEnable="True" AlarmType="True" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="True" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="40004-40005低低报警" LowAlarmEnable="True" LowAlarmValue="20" LowAlarmPriority="0" LowAlarmNote="40004-40005低报警" HighAlarmEnable="True" HighAlarmValue="80" HighAlarmPriority="0" HighAlarmNote="40004-40005高报警" HiHiAlarmEnable="True" HiHiAlarmValue="100" HiHiAlarmPriority="0" HiHiAlarmNote="40004-40005高高报警" ArchivePeriod="80" SetLimitMax="100" SetLimitMin="0" VarType="Float" />
<Variable NameXML="Ushort1" Description="40007" Type="ModbusTCP" VarAddress="6" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="True" SetLimitEnable="True" AlarmType="True" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="True" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="具体的通讯变量地址及类型低低报警" LowAlarmEnable="True" LowAlarmValue="20" LowAlarmPriority="0" LowAlarmNote="具体的通讯变量地址及类型低报警" HighAlarmEnable="True" HighAlarmValue="80" HighAlarmPriority="0" HighAlarmNote="具体的通讯变量地址及类型高报警" HiHiAlarmEnable="True" HiHiAlarmValue="100" HiHiAlarmPriority="0" HiHiAlarmNote="具体的通讯变量地址及类型高高报警" ArchivePeriod="0" SetLimitMax="100" SetLimitMin="0" VarType="UShort" />
<Variable NameXML="Ushort2" Description="40008" Type="ModbusTCP" VarAddress="7" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="True" SetLimitEnable="True" AlarmType="True" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="True" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="Ushort2低低报警" LowAlarmEnable="True" LowAlarmValue="20" LowAlarmPriority="0" LowAlarmNote="Ushort2低报警" HighAlarmEnable="True" HighAlarmValue="80" HighAlarmPriority="0" HighAlarmNote="Ushort2高报警" HiHiAlarmEnable="True" HiHiAlarmValue="100" HiHiAlarmPriority="0" HiHiAlarmNote="Ushort2高高报警" ArchivePeriod="80" SetLimitMax="100" SetLimitMin="0" VarType="UShort" />
<Variable NameXML="Bool1" Description="40009.0" Type="ModbusTCP" VarAddress="8.0" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="False" SetLimitEnable="True" AlarmType="False" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="False" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="" LowAlarmEnable="False" LowAlarmValue="0" LowAlarmPriority="0" LowAlarmNote="" HighAlarmEnable="False" HighAlarmValue="0" HighAlarmPriority="0" HighAlarmNote="" HiHiAlarmEnable="False" HiHiAlarmValue="0" HiHiAlarmPriority="0" HiHiAlarmNote="" SetLimitMax="100" SetLimitMin="0" VarType="Bool" />
<Variable NameXML="Bool2" Description="40009.1" Type="ModbusTCP" VarAddress="8.1" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="False" SetLimitEnable="True" AlarmType="False" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="False" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="" LowAlarmEnable="False" LowAlarmValue="0" LowAlarmPriority="0" LowAlarmNote="" HighAlarmEnable="False" HighAlarmValue="0" HighAlarmPriority="0" HighAlarmNote="" HiHiAlarmEnable="False" HiHiAlarmValue="0" HiHiAlarmPriority="0" HiHiAlarmNote="" SetLimitMax="100" SetLimitMin="0" VarType="Bool" />
<Variable NameXML="Bool3" Description="40009.2" Type="ModbusTCP" VarAddress="8.2" Scale="1" Offset="0" Start="0" AccessProperty="读写" AlarmEnable="True" ArchiveEnable="False" SetLimitEnable="True" AlarmType="False" DiscreteAlarmType="False" DiscreteAlarmPriority="0" DiscreteAlarmNote="" LoLoAlarmEnable="False" LoLoAlarmValue="0" LoLoAlarmPriority="0" LoLoAlarmNote="" LowAlarmEnable="False" LowAlarmValue="0" LowAlarmPriority="0" LowAlarmNote="" HighAlarmEnable="False" HighAlarmValue="0" HighAlarmPriority="0" HighAlarmNote="" HiHiAlarmEnable="False" HiHiAlarmValue="0" HiHiAlarmPriority="0" HiHiAlarmNote="" SetLimitMax="100" SetLimitMin="0" VarType="Bool" />
</ModbusGroup>
</ModbusNode>
</NodeClass>
</Settings>
Json:文章来源地址https://www.toymoban.com/news/detail-509801.html
{
"ConnectionStrings": {
"SqliteConnectionString": "Data Source=E:\\Csharp\\EF6Demon\\EF6Demon\\bin\\Debug\\net6.0-windows\\Database\\DbSqlite.db",
"MySQLConnectionString": "server=192.168.85.102; database=OneToMany; uid=root; pwd=123456;"
},
"NodeClass": {
"Id": 1,
"Name": "ModbusClent",
"Description": "Modbus相关客户端",
"ModbusNode": {
"Id": 1,
"NodeClassId": 1,
"Name": "ModbusTCPClient",
"Description": "1#ZG上位机测试",
"ModbusType": "2000",
"ConnectTimeOut": "2000",
"CreateTime": "0",
"ReConnectTime": "5000",
"IsActive": "True",
"MaxErrorTimes": "1",
"KeyWay": "VarName",
"UseAlarmCheck": "True",
"ServerURL": "127.0.0.1",
"Port": "502",
"DataFormat": "ABCD",
"VarNum": "6",
"ModbusGroup": {
"Id": 1,
"Name": "保持寄存器长度为寄存器个数",
"Description": "40001-40010",
"Type": "ModbusTCP",
"StoreArea": "40000",
"Length": "10",
"Start": "0",
"SlaveID": "1",
"IsActive": "true",
"ModbusNodeId": 1,
"Variable": [
{
"Id": 1,
"Number": "1",
"Name": "Float1",
"Description": "40001-40002",
"Type": "ModbusTCP",
"VarAddress": 0,
"Scale": "1",
"Offset": "0",
"Start": "0",
"AccessProperty": "读写",
"AlarmEnable": "True",
"ArchiveEnable": "True",
"SetLimitEnable": "True",
"AlarmType": "True",
"DiscreteAlarmType": "False",
"DiscreteAlarmPriority": "0",
"DiscreteAlarmNote": "null",
"LoLoAlarmEnable": "True",
"LoLoAlarmValue": "0",
"LoLoAlarmPriority": "0",
"LoLoAlarmNote": "40001-40002低低报警",
"LowAlarmEnable": "True",
"LowAlarmValue": "20",
"LowAlarmPriority": "0",
"LowAlarmNote": "40001-40002低报警",
"HighAlarmEnable": "True",
"HighAlarmValue": "80",
"HighAlarmPriority": "0",
"HighAlarmNote": "40001-40002高报警",
"HiHiAlarmEnable": "True",
"HiHiAlarmValue": "100",
"HiHiAlarmPriority": "0",
"HiHiAlarmNote": "40001-40002高高报警",
"ArchivePeriod": "80",
"SetLimitMax": "100",
"SetLimitMin": "0",
"VarType": "Float",
"StoreType": "03 Holding Register(4x)",
"InsertTime": "0",
"Value": "0",
"ModbusGroupId": 1
},
{
"Id": 2,
"Number": "2",
"Name": "Float2",
"Description": "40003-40004",
"Type": "ModbusTCP",
"VarAddress": 2,
"Scale": "1",
"Offset": "0",
"Start": "0",
"AccessProperty": "读写",
"AlarmEnable": "True",
"ArchiveEnable": "True",
"SetLimitEnable": "True",
"AlarmType": "True",
"DiscreteAlarmType": "False",
"DiscreteAlarmPriority": "0",
"DiscreteAlarmNote": "null",
"LoLoAlarmEnable": "True",
"LoLoAlarmValue": "0",
"LoLoAlarmPriority": "0",
"LoLoAlarmNote": "40003-40004低低报警",
"LowAlarmEnable": "True",
"LowAlarmValue": "20",
"LowAlarmPriority": "0",
"LowAlarmNote": "40003-40004低报警",
"HighAlarmEnable": "True",
"HighAlarmValue": "80",
"HighAlarmPriority": "0",
"HighAlarmNote": "40003-40004高报警",
"HiHiAlarmEnable": "True",
"HiHiAlarmValue": "100",
"HiHiAlarmPriority": "0",
"HiHiAlarmNote": "40003-40004高高报警",
"ArchivePeriod": "80",
"SetLimitMax": "100",
"SetLimitMin": "0",
"VarType": "Float",
"StoreType": "03 Holding Register(4x)",
"InsertTime": "0",
"Value": "0",
"ModbusGroupId": 1
},
{
"Id": 3,
"Number": "3",
"Name": "Float3",
"Description": "40005-40006",
"Type": "ModbusTCP",
"VarAddress": 4,
"Scale": "1",
"Offset": "0",
"Start": "0",
"AccessProperty": "读写",
"AlarmEnable": "True",
"ArchiveEnable": "True",
"SetLimitEnable": "True",
"AlarmType": "True",
"DiscreteAlarmType": "False",
"DiscreteAlarmPriority": "0",
"DiscreteAlarmNote": "null",
"LoLoAlarmEnable": "True",
"LoLoAlarmValue": "0",
"LoLoAlarmPriority": "0",
"LoLoAlarmNote": "40005-40006低低报警",
"LowAlarmEnable": "True",
"LowAlarmValue": "20",
"LowAlarmPriority": "0",
"LowAlarmNote": "40005-40006低报警",
"HighAlarmEnable": "True",
"HighAlarmValue": "80",
"HighAlarmPriority": "0",
"HighAlarmNote": "40005-40006高报警",
"HiHiAlarmEnable": "True",
"HiHiAlarmValue": "100",
"HiHiAlarmPriority": "0",
"HiHiAlarmNote": "40005-40006高高报警",
"ArchivePeriod": "80",
"SetLimitMax": "100",
"SetLimitMin": "0",
"VarType": "Float",
"StoreType": "03 Holding Register(4x)",
"InsertTime": "0",
"Value": "0",
"ModbusGroupId": 1
},
{
"Id": 4,
"Number": "4",
"Name": "Float4",
"Description": "40007-40008",
"Type": "ModbusTCP",
"VarAddress": 6,
"Scale": "1",
"Offset": "0",
"Start": "0",
"AccessProperty": "读写",
"AlarmEnable": "True",
"ArchiveEnable": "True",
"SetLimitEnable": "True",
"AlarmType": "True",
"DiscreteAlarmType": "False",
"DiscreteAlarmPriority": "0",
"DiscreteAlarmNote": "null",
"LoLoAlarmEnable": "True",
"LoLoAlarmValue": "0",
"LoLoAlarmPriority": "0",
"LoLoAlarmNote": "40003-40004低低报警",
"LowAlarmEnable": "True",
"LowAlarmValue": "20",
"LowAlarmPriority": "0",
"LowAlarmNote": "40003-40004低报警",
"HighAlarmEnable": "True",
"HighAlarmValue": "80",
"HighAlarmPriority": "0",
"HighAlarmNote": "40003-40004高报警",
"HiHiAlarmEnable": "True",
"HiHiAlarmValue": "100",
"HiHiAlarmPriority": "0",
"HiHiAlarmNote": "40003-40004高高报警",
"ArchivePeriod": "80",
"SetLimitMax": "100",
"SetLimitMin": "0",
"VarType": "Float",
"StoreType": "03 Holding Register(4x)",
"InsertTime": "0",
"Value": "0",
"ModbusGroupId": 1
},
{
"Id": 5,
"Number": "5",
"Name": "Ushort1",
"Description": "40009",
"Type": "ModbusTCP",
"VarAddress": 8,
"Scale": "1",
"Offset": "0",
"Start": "0",
"AccessProperty": "读写",
"AlarmEnable": "True",
"ArchiveEnable": "True",
"SetLimitEnable": "True",
"AlarmType": "True",
"DiscreteAlarmType": "False",
"DiscreteAlarmPriority": "0",
"DiscreteAlarmNote": "null",
"LoLoAlarmEnable": "True",
"LoLoAlarmValue": "0",
"LoLoAlarmPriority": "0",
"LoLoAlarmNote": "40009低低报警",
"LowAlarmEnable": "True",
"LowAlarmValue": "20",
"LowAlarmPriority": "0",
"LowAlarmNote": "40009低报警",
"HighAlarmEnable": "True",
"HighAlarmValue": "80",
"HighAlarmPriority": "0",
"HighAlarmNote": "40009高报警",
"HiHiAlarmEnable": "True",
"HiHiAlarmValue": "100",
"HiHiAlarmPriority": "0",
"HiHiAlarmNote": "40009高高报警",
"ArchivePeriod": "80",
"SetLimitMax": "100",
"SetLimitMin": "0",
"VarType": "UShort",
"StoreType": "03 Holding Register(4x)",
"InsertTime": "0",
"Value": "0",
"ModbusGroupId": 1
},
{
"Id": 6,
"Number": "6",
"Name": "Ushort2",
"Description": "40010",
"Type": "ModbusTCP",
"VarAddress": 9,
"Scale": "1",
"Offset": "0",
"Start": "0",
"AccessProperty": "读写",
"AlarmEnable": "True",
"ArchiveEnable": "True",
"SetLimitEnable": "True",
"AlarmType": "True",
"DiscreteAlarmType": "False",
"DiscreteAlarmPriority": "0",
"DiscreteAlarmNote": "null",
"LoLoAlarmEnable": "True",
"LoLoAlarmValue": "0",
"LoLoAlarmPriority": "0",
"LoLoAlarmNote": "40009低低报警",
"LowAlarmEnable": "True",
"LowAlarmValue": "20",
"LowAlarmPriority": "0",
"LowAlarmNote": "40009低报警",
"HighAlarmEnable": "True",
"HighAlarmValue": "80",
"HighAlarmPriority": "0",
"HighAlarmNote": "40009高报警",
"HiHiAlarmEnable": "True",
"HiHiAlarmValue": "100",
"HiHiAlarmPriority": "0",
"HiHiAlarmNote": "40009高高报警",
"ArchivePeriod": "80",
"SetLimitMax": "100",
"SetLimitMin": "0",
"VarType": "UShort",
"StoreType": "03 Holding Register(4x)",
"InsertTime": "0",
"Value": "0",
"ModbusGroupId": 1
}
]
}
}
}
}
到了这里,关于在.NetFramework中使用Microsoft.Extensions.Configuration 读取Json和XML的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!