private void WriteConfiguration() { //保存5条信息,默认取第一条,新登录的顶到第一条,删除最后一条,逗号分隔 1,2,3,'','' string[] serverNameArray = IO_Helper_DG.Ini_SelectStringValue(CommonVariables.configFilePath, "sqlserver", "ServerName", ".").Split(','); string[] newServerNameArray = new string[] { comboBox2.Text, "", "", "", "" };//save 5 lines int newServerNameIndex = 1; foreach (var item in serverNameArray) { if (!newServerNameArray.Contains(item)) { newServerNameArray[newServerNameIndex] = item; newServerNameIndex++; } } IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "sqlserver", "ServerName", string.Join(",", newServerNameArray)); IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "sqlserver", "Authentication", comboBox3.Text); if (checkBox1.Checked) { string[] saLoginArray = IO_Helper_DG.Ini_SelectStringValue(CommonVariables.configFilePath, "sqlserver", "SaLogin", ".").Split(','); string[] newSaLoginArray = new string[] { comboBox4.Text, "", "", "", "" };//save 5 lines int newsaLoginIndex = 1; foreach (var item in saLoginArray) { if (!newSaLoginArray.Contains(item)) { newSaLoginArray[newsaLoginIndex] = item; newsaLoginIndex++; } } IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "sqlserver", "SaLogin", string.Join(",", newSaLoginArray)); IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "sqlserver", "SaPassword", textBox1.Text); } }
private void WriteConfiguration() { IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "mysql", "ServerName", textBox1.Text.Trim()); IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "mysql", "Port", textBox2.Text.Trim()); IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "mysql", "Login", textBox3.Text.Trim()); IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "mysql", "Password", textBox4.Text.Trim()); }
//write ini config record the opration history private void setInitConfigFile() { //set config IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "config", "outputType", comboBox2.Text);//output type //set code builder config //IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "usings", textBox3.Text.Replace("\n","&")); //using IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "namespace", textBox2.Text); //namespace IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "namespaceCommonPlus", textBox10.Text); //namespace IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "TableName", textBox9.Text); //table name IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "class", textBox5.Text); //class name IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "ClassNamePlus", textBox7.Text); // ClassExtends IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "ClassExtends", textBox8.Text); // ClassExtends IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "fileName", textBox4.Text); //fileName IO_Helper_DG.Ini_Update(CommonVariables.configFilePath, "code", "fileNameSuffix", comboBox1.Text); //fileName }