Ejemplo n.º 1
0
        static void TestConfigUtil()
        {
            string value1 = ConfigUtil.Settings["key1"];

            Console.WriteLine($"key1 = {value1}");

            Console.Write($"Please input value: ");
            string     str  = Console.ReadLine();
            ConfigUtil util = new ConfigUtil(ConfigType.EXE);

            util.AddAppSetting("key1", str);
            util.Save();
            value1 = util.AppSettings["key1"];
            Console.WriteLine($"key1 = {value1}");
            value1 = ConfigUtil.Settings["key1"];
            Console.WriteLine($"key1 = {value1}");
        }