ConfigSaveByJson 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package ConfigSaveByJson --version 1.0.0
NuGet\Install-Package ConfigSaveByJson -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConfigSaveByJson" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConfigSaveByJson --version 1.0.0
#r "nuget: ConfigSaveByJson, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ConfigSaveByJson as a Cake Addin
#addin nuget:?package=ConfigSaveByJson&version=1.0.0

// Install ConfigSaveByJson as a Cake Tool
#tool nuget:?package=ConfigSaveByJson&version=1.0.0

将你的配置类调用write(T model, string path)写入,开启时调用read(string path)读取

    class Program
    {
        public static TestModel _testmodel;

        static void Main(string[] args)
        {
            //写入
            ConfigSaveByJson.ConfigSaveByJson.Write(new TestModel(),Path.Combine( Environment.CurrentDirectory,"test.json"));

            //读取
            _testmodel = ConfigSaveByJson.ConfigSaveByJson.Read<TestModel>(Path.Combine(Environment.CurrentDirectory, "test.json"));

            Console.WriteLine(_testmodel.Name + _testmodel.Url);
            Console.ReadKey();
        }
    }
    /// <summary>
    /// 测试用的类
    /// </summary>
    [DataContract]
    public class TestModel
    {
        [DataMember]
        public string Name { get; set; } = "Kong";

        [DataMember]
        public string Url { get; set; } = "jiangsimpler.github.com";
    }
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated

保存读取配置文件