我写这个是为了快速测试
为什么我的设置没有保存?我第一次运行它时,我有 3(旧)/3(当前)元素。我第二次得到 3(旧)/5(当前),第三次得到 5(旧)/5(当前)。
当我关闭应用程序时,设置完全消失。当我运行它时,它又是 3。我没有对应用程序进行任何更改。为什么我的设置没有保存
private void button2_Click(object sender, EventArgs e)
{
MyApp.Properties.Settings.Default.Reload();
var saveDataold = MyApp.Properties.Settings.Default.Context;
var saveData = MyApp.Properties.Settings.Default.Context;
saveData["user"] = textBox1.Text;
saveData["pass"] = textBox2.Text;
MyApp.Properties.Settings.Default.Save();
}