Properties.Settings.Default 不保存值

Properties.Settings.Default Doesn't save the values

我制作了一个 wpf 应用程序,但在设置 window 中,我正在更改视图中列出的文本框的文本,然后单击保存 按钮更新 Properties.Settings.Default。然后,我关闭设置 window。我回到MainWindow。但是当我关闭应用程序时,在下一个会话中我的值不会显示。我该如何解决?

保存按钮:

private void save_Click(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.PC_Name = pcname.Text;
            Properties.Settings.Default.Acc_name = name.Text;
            Properties.Settings.Default.Acc_sname = sname.Text;
        }

加载事件(页):

private void ayarlarekrani_Loaded(object sender, RoutedEventArgs e)
        {
            pcname.Text = Properties.Settings.Default.PC_Name;
            name.Text = Properties.Settings.Default.Acc_name;
            sname.Text= Properties.Settings.Default.Acc_sname;

        }

看起来你失踪了:

Properties.Settings.Default.Save();

http://docs.microsoft.com/en-us/dotnet/framework/winforms/advanced/how-to-write-user-settings-at-run-time-with-csharp