private SaveFile ( string filePath, IniParser.IniData parsedData ) : void | ||
filePath | string | |
parsedData | IniParser.IniData | |
return | void |
public static void Main() { //Create an instance of a ini file parser FileIniDataParser fileIniData = new FileIniDataParser(); if (File.Exists("NewTestIniFile.ini")) File.Delete("NewTestIniFile.ini"); //Parse the ini file IniData parsedData = fileIniData.LoadFile("TestIniFile.ini"); //Write down the contents of the ini file to the console Console.WriteLine("---- Printing contents of the INI file ----\n"); Console.WriteLine(parsedData.ToString()); //Get concrete data from the ini file Console.WriteLine("---- Printing contents concrete data from the INI file ----"); Console.WriteLine("setMaxErrors = " + parsedData["GeneralConfiguration"]["setMaxErrors"]); Console.WriteLine(); //Modify the INI contents and save Console.WriteLine(); //Write down the contents of the modified ini file to the console Console.WriteLine("---- Printing contents of the new INI file ----\n"); IniData modifiedParsedData = ModifyINIData(parsedData); Console.WriteLine(modifiedParsedData.ToString()); //Save to a file fileIniData.SaveFile("NewTestIniFile.ini", modifiedParsedData); }
public void savePreset() { parsedData["preset"].AddKey("name"); parsedData["preset"].AddKey("description"); parsedData["preset"]["name"] = name; parsedData["preset"]["description"] = description; parser.SaveFile(path, parsedData); }
public void SetKeyFieldValue(string section_nm, string strKey_nm, string strKeyValue) { parsedData = parser.LoadFile(this.path); parsedData[section_nm][strKey_nm] = strKeyValue; parser.SaveFile(path, parsedData); }
public void writeIni() { parser.SaveFile(path, parsedData); }
public static void EmuleAdunanzaConfigSetKey(string key, string value) { //Create an instance of a ini file parser IniParser.FileIniDataParser iniparser = new FileIniDataParser(); IniData data = iniparser.ReadFile(EmuleAdunanzAConfigFileGetPath()); data["eMule"][key] = value; iniparser.SaveFile(EmuleAdunanzAConfigFileGetPath(), data); }
public static void EmuleAdunanzASetUdpPort(int port) { if ((port > 65554) && (port == 0)) { throw new Exception("la Porta UDP da configurare non e' valida"); } //Create an instance of a ini file parser IniParser.FileIniDataParser iniparser = new FileIniDataParser(); IniData data = iniparser.ReadFile(EmuleAdunanzAConfigFileGetPath()); data["eMule"]["UDPPort"] = port.ToString(); iniparser.SaveFile(EmuleAdunanzAConfigFileGetPath(), data); }
public static void AmuleAdunanzaSetTcpPort(int port) { if ((port > 65554) && (port == 0)) { throw new Exception("la Porta TCP da configurare non e' valida"); } var conf = AmuleAdunanzaAduboxConfigFileGetPath(); //Create an instance of a ini file parser IniParser.FileIniDataParser iniparser = new FileIniDataParser(); IniData data = iniparser.ReadFile(conf); data["eMule"]["Port"] = port.ToString(); iniparser.SaveFile(conf, data); }
private void Tour_FormClosed(object sender, FormClosedEventArgs e) { FileIniDataParser parser = new FileIniDataParser(); this.config["settings"]["tourEnabled"] = (!this.checkBox1.Checked).ToString(); parser.SaveFile(this.configFilePath, this.config); }
public void Save() { try { IniData data = new IniData(); data.Sections.AddSection("Settings"); data.Sections.GetSectionData("Settings").Keys.AddKey("AutoLoad", AutoLoad.ToString()); data.Sections.GetSectionData("Settings").Keys.AddKey("AutoUpdate", AutoUpdate.ToString()); data.Sections.GetSectionData("Settings").Keys.AddKey("LastLoadPath", LastLoadPath); data.Sections.GetSectionData("Settings").Keys.AddKey("SteamID", SteamID.ToString()); data.Sections.GetSectionData("Settings").Keys.AddKey("UserKey", UserKey); FileIniDataParser parser = new FileIniDataParser(); parser.SaveFile(SettingPath, data); } catch (Exception e) { Debug.WriteLine(e.ToString()); } }
protected void Save(string filePath, IniData iniData) { IniParser.FileIniDataParser parser = new IniParser.FileIniDataParser(); parser.SaveFile(filePath, iniData); }
protected void Save(string filePath, IniData iniData) { IniParser.FileIniDataParser parser = new IniParser.FileIniDataParser(); parser.SaveFile(filePath, iniData); }