.net 使用ConfigurationBuilder 读取配置json文件
hosting.josn 配置

读取
var config= new ConfigurationBuilder() .AddJsonFile("hosting.json", optional: true) .Build();

取值
string sqlString = config.GetSection("server.urls").Value; //读取参数的属性,要读取的时候每一级里面加入:即可 string a = config.GetSection("多级:一:一点一").Value;
相关链接

浙公网安备 33010602011771号