引用: Microsoft.Extensions.ConfigurationMicrosoft.Extensions.Configuration.FileExtensionsMicrosoft.Extensions.Configuration.Json 创建json文件: 设置json文件 class Program { public static void Main(string[] args) { var builder = new ConfigurationBuilder() .SetBa
This is something that strangely doesn’t seem to be that well documented and took me a while to figure out though in the end it’s pretty simple. All that’s required is to add the following NuGet packages and an appsettings.json file. Microsoft.Extens
随手写了一个java小工具,maven打包成功后,发现工具总是读不到打在jar包中的文件信息,要读取的文件位于 /src/main/resources 目录下,打包成功后,文件就在jar包中根目录下,一直以为是路径错误,之后用this.getClass().getClassLoader().getResource("").getPath();发现路径是xxx.jar!/com/demo/..形式,路径总是获取不对. 之后试了一下BufferedReader in = new Buffe