添加持久设置后调试速度非常慢

时间:2012-10-20 22:03:55

标签: c# .net visual-studio-2010 performance visual-studio

我有一个半小的可视化C#解决方案,我在Visual Studio 2010中工作。我最近使用settings.Settings文件和Properties.Settings.Default添加了持久性设置。在Form Load事件中,我使用Properties.Settings.Default检查值,并将它们分配给checkbox.Checked变量。

//Load Form1
private void Form1_Load(object sender, System.EventArgs e)
{
    cbxShowPass.Checked = Properties.Settings.Default.showFullPassword;
    checkBox2.Checked = Properties.Settings.Default.showBookmarkFiles;
}

当我在调试模式下启动程序时,启动速度非常慢,但是,当我删除该行代码时,它会很快启动。

如何在不删除设置的情况下使我的程序在调试模式下快速启动?

以下是我的CheckBox_Changed事件,我将值分配给设置。

private void ShowPass_CheckChanged(object sender, EventArgs e)
{
    Properties.Settings.Default.showFullPassword = !Properties.Settings.Default.showFullPassword;
        Properties.Settings.Default.Save();
        DisplayPassword();
}

0 个答案:

没有答案
相关问题