Json Config for .NET Framework , support hot fix.
JsonConfig.Regist<TestConfig>();
var tc = JsonConfig.Get<TestConfig>();
JsonConfig.Save(tc);
JsonConfig.Init(...);
JsonConfig.Regist<...>();
- Exe : ./Cfgs
- WebSite: ./App_Data/Cfgs (App_Data is a security folder, you can't access it from the internet, so Config files in it is very safe.)
If you want watch change, you can do like this:
JsonConfig.Regist<ZowoYooApiConfig>();
var cfg = JsonConfig.Get<ZowoYooApiConfig>();
cfg.Changed += Cfg_Changed;
}
private void Cfg_Changed(object sender, ChangedEventArg e)
{
Debug.WriteLine(e.NewJson);
}