예제 #1
0
        public static void SaveConfigs()
        {
            HistoryConfig config = new HistoryConfig {
                IsIPPrinter       = IsIPPrinter,
                HistorySigninName = HistorySigninName,
                HistoryPassword   = HistoryPassword,
                HistoryIPAddress  = HistoryIPAddress,
            };
            string configStr = JsonConvert.SerializeObject(config);

            File.WriteAllText(configFilePath, configStr);
        }
예제 #2
0
        public static void LoadConfigs()
        {
            if (!File.Exists(configFilePath))
            {
                return;
            }

            string configStr = File.ReadAllText(configFilePath);

            try {
                HistoryConfig config = JsonConvert.DeserializeObject <HistoryConfig>(configStr);
                IsIPPrinter       = config.IsIPPrinter;
                HistorySigninName = config.HistorySigninName;
                HistoryPassword   = config.HistoryPassword;
                HistoryIPAddress  = config.HistoryIPAddress;
            }
            catch { }
        }