public void write(string[] setting) { try { INIHelper ini = new INIHelper(@"./CurrStandard.ini", "Demo"); List <string> keyList = new List <string>(); for (int i = 1; i < 7; i++) { string s1 = "Item" + i + "_HeadH"; string s2 = "Item" + i + "_HeadL"; string s3 = "Item" + i + "_TailH"; string s4 = "Item" + i + "_TailL"; keyList.Add(s1); keyList.Add(s2); keyList.Add(s3); keyList.Add(s4); } string[] Key = keyList.ToArray(); ini.write(Key, setting); } catch (Exception) { MessageBox.Show("写曲线范围出错", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void FormTest_FormClosing(object sender, FormClosingEventArgs e) { string[] s = new string[] { textBox5.Text, textBox6.Text, textBox7.Text, textBox8.Text, textBox9.Text }; string[] key = new string[] { label5.Text, label6.Text, label7.Text, label8.Text, label9.Text }; INIHelper iniHelper = new INIHelper(); iniHelper.write(key, s); }