.netcore 读取配置信息

1.将配置信息写在appsetting.json里面

 

 2.创建一个类,包含配置文件的属性

public class AppSettingModel
    {
        public string CC_URL { get; set; }
    }

3.startup里面,将配置文件和类绑定

 

 4.使用

 

posted @ 2021-01-13 13:41  汪汪汪~~  阅读(152)  评论(0编辑  收藏  举报