Exemple #1
0
        private void SaveMariaDbConfig()
        {
            try
            {
                var basePath = Main.StartupPath.Replace(@"\", "/");
                var confPath = Main.StartupPath + "/conf/mariadb/my.ini";
                var iniFile  = new IniFile.IniFile(confPath);
                var port     = MariaDbPort.Value.ToString();

                //iniFile.Section("mysqld").Set("basedir", Main.StartupPath);
                iniFile.Section("mysqld").Set("datadir", basePath + "/data/mariadb");
                iniFile.Section("mysqld").Set("tmpdir", basePath + "/tmp");
                iniFile.Section("mysqld").Set("innodb_data_home_dir", basePath + "/data/mariadb");
                iniFile.Section("mysqld").Set("innodb_log_group_home_dir", basePath + "/data/mariadb");

                iniFile.Section("client").Set("port", port);
                iniFile.Section("mysqld").Set("port", port);

                iniFile.Section("mysqld").Set("character_set_server", MariaDbCharset.Value.ToString());
                iniFile.Section("mysqld").Set("bind-address", MariaDbBind.Value.ToString());

                iniFile.Save(confPath);
            }
            catch (Exception ex) { }
        }
Exemple #2
0
        private void UpdateEnverionments(IniFile.IniFile iniFile)
        {
            var section = iniFile.Section("WNE-ENV");

            foreach (var val in EnverionmentValues)
            {
                section.Set(val.Key, val.Value);
            }
        }
Exemple #3
0
        private void ReadEnverionments(IniFile.IniFile iniFile)
        {
            Dictionary <string, string> envs = new Dictionary <string, string>();
            var section = iniFile.Section("WNE-ENV");

            foreach (var prop in section.Properties)
            {
                envs.Add(prop.Name, prop.Value);
            }
            EnverionmentValues = envs;
        }
Exemple #4
0
 public void PrintIniOption(IniFile.IniFile iniFile)
 {
     iniFile.Section(Section).Set(Name, Value.ToString(), Description);
 }
Exemple #5
0
 public void ReadIniValue(IniFile.IniFile iniFile)
 {
     iniValue = iniFile.Section(Section).Get(Name);
 }