123456789101112131415161718192021222324 |
- namespace KYFramework
- {
- public static class ConfigHelper
- {
-
- public static string GetText(string key)
- {
- try
- {
- string configStr = File.ReadAllText("Config/" + key + ".txt");
- return configStr;
- }
- catch (Exception e)
- {
- throw new Exception($"load config file fail, key: {key}", e);
- }
- }
-
- public static T ToObject<T>(string str)
- {
- return JsonHelper.FromJson<T>(str);
- }
- }
- }
|