ASP.NET Core 读取json配置文件

2020年4月16日 2038点热度 0人点赞 0条评论
内容纲要
        public IConfigurationRoot Config { get; } = new ConfigurationBuilder()
                .SetBasePath(System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Options"))
                .AddJsonFile("SystemConfig.json", optional: true, reloadOnChange: true)
                .Build();

此方法可以读取json文件中的配置。
只能读不能写。

痴者工良

高级程序员劝退师

文章评论