转自:http://wenwen.soso.com/z/q185771150.htm
1. 输入框
private void button1_Click(object sender, EventArgs e)
{
try
{
if (this.textBox1.Text != "")
{
SecFresh = Convert.ToInt32(this.textBox1.Text.Trim());
this.DialogResult = DialogResult.OK;
}
}
catch { }
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
2. 保存
Form1 frmset = new Form1();
frmset.SecFresh = sr;
if (frmset.ShowDialog(this)== DialogResult.OK)
{
try
{
this.sr = frmset.SecFresh;
CLC.INIClass.IniPathSet(Application.StartupPath + "\\ConfigBJXX.ini");
CLC.INIClass.IniWriteValue("配置", "更新频率", sr.ToString());
this.timePeople.Interval = sr * 1000;
MessageBox.Show("更改成功", "系统提示");
}
catch { MessageBox.Show("更改失败", "系统提示"); }
}