【问题标题】:Properties.Settings.Default Doesn't save the valuesProperties.Settings.Default 不保存值
【发布时间】:2018-09-20 10:16:27
【问题描述】:

我正在制作一个 wpf 应用程序,但在设置窗口中,我正在更改视图中列出的文本框的文本,然后单击保存 按钮更新Properties.Settings.Default。然后,我关闭设置窗口。我回到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;

        }

【问题讨论】:

    标签: c# wpf xaml properties settings


    【解决方案1】:
    猜你喜欢
    • 2011-12-21
    • 2011-01-09
    • 2010-12-20
    • 1970-01-01
    • 1970-01-01
    • 2013-07-07
    • 2013-03-02
    • 2010-11-02
    • 1970-01-01
    相关资源
    最近更新 更多