【发布时间】:2016-10-20 06:25:23
【问题描述】:
在设置选项卡的项目属性中,我添加了值*.*。
然后我添加了另一个 Setting1 并添加到它的值 c:\
然后在form1构造函数中:
textBox2.Text = (string)Properties.Settings.Default["Setting"];
textBox3.Text = (string)Properties.Settings.Default["Setting1"];
我希望每次用户在其中一个文本框中输入内容时,它都会将其保存到设置中。
private void textBox2_TextChanged(object sender, EventArgs e)
{
Properties.Settings.Default["Setting"] = textBox2.Text;
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
Properties.Settings.Default["Setting1"] = textBox3.Text;
}
但是每次我运行我的程序时,我都会得到第一个设置*.* 和c:\。
【问题讨论】: