BEGroup.Utility.IniFile.SetValue C# (CSharp) Метод

SetValue() публичный Метод

Sets the value of the specified key in the specified section. If the section and/or key does not exist, they will be created.
public SetValue ( string section, string key, string value ) : void
section string Section name
key string Key name
value string Value
Результат void
        public void SetValue(string section, string key, string value)
        {
            if (!ContainsKey(section, key)) CreateKey(section, key);
            _content[section][key] = value;
        }

Usage Example

Пример #1
0
            /// <summary>
            /// Saves all custom vehicles
            /// </summary>
            public static void SaveCustomVehicles()
            {
                if (File.Exists(CONFIG_FILE_CUSTOM_VEHICLES)) File.Delete(CONFIG_FILE_CUSTOM_VEHICLES);
                if (CustomVehicles == null || CustomVehicles.Count == 0) return;

                IniFile ini = new IniFile(CONFIG_FILE_CUSTOM_VEHICLES);

                ini.SetValue(CONFIG_CV, CONFIG_CV_COUNT, CustomVehicles.Count.ToString());
                for (int i = 0; i < CustomVehicles.Count; i++)
                {
                    ini.SetValue(CONFIG_CV, Utils.FormatML(CONFIG_CV_ITEM, i + 1), CustomVehicles[i].Serialize());
                }
                ini.Save();
            }
All Usage Examples Of BEGroup.Utility.IniFile::SetValue