# GenericJsonConfig **Repository Path**: eslib/generic-json-config ## Basic Information - **Project Name**: GenericJsonConfig - **Description**: 使用json/bson作读写配置文件的类库 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-05 - **Last Updated**: 2024-08-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # note #### 介绍 方便使用JSon/BSon保存和读写配置文件的工具 使用JSon/Bson作网络数据传输的类库:https://gitee.com/eslib/nnp5cs nuget搜索nnp5 #### 使用 ``` private static void bsonTest() { CustomConfig cfg = new() { value = 9394, str = "bson string section", flt = 6.28f, }; //保存bson文件 GenericBsonConfig.Save(cfg, "config.bson"); //读取 CustomConfig readcfg = GenericBsonConfig.Load("config.bson"); WriteLine($"从bson读取:{readcfg}"); } private static void jsonTest() { CustomConfig cfg = new() { value = 1314, str = "json test string", flt = 3.14f, }; //保存json文件 GenericJsonConfig.Save(cfg, "config.json"); //读取 CustomConfig readcfg = GenericJsonConfig.Load("config.json"); WriteLine($"从json读取:{readcfg}"); } ```