我有一个有6个倒数计时器的应用程序。我希望应用程序存储当前结束时间,以防计算机关闭,日期将被保存,不会丢失任何内容。
我的问题是应用程序正在保存日期,但是当再次启动应用程序时,它会重新加载默认设置而不是保存的设置。
public MainWindow()
{
InitializeComponent();
SetupTimer(timer0, watch0_0Time, watch0_0Border);
SetupTimer(timer1, watch0_1Time, watch0_1Border);
SetupTimer(timer2, watch0_2Time, watch0_2Border);
SetupTimer(timer3, watch1_0Time, watch1_0Border);
SetupTimer(timer4, watch1_1Time, watch1_1Border);
SetupTimer(timer5, watch1_2Time, watch1_2Border);
timer0.countTo = Properties.Settings.Default.Timer0Date;
timer1.countTo = Properties.Settings.Default.Timer1Date;
timer2.countTo = Properties.Settings.Default.Timer2Date;
timer3.countTo = Properties.Settings.Default.Timer3Date;
timer4.countTo = Properties.Settings.Default.Timer4Date;
timer5.countTo = Properties.Settings.Default.Timer5Date;
}
...
我稍后会通过此次通话
进行保存Properties.Settings.Default.Timer0Date = timer.countTo;
我希望你能帮忙:D