1.每次變動都保存spa
Properties.Settings.Default.PropertyChanged += Default_PropertyChanged; private void Default_PropertyChanged(object sender, PropertyChangedEventArgs e) { Properties.Settings.Default.Save(); }
2. 退出時保存code
Application.ApplicationExit += new EventHandler(Application_ApplicationExit); void Application_ApplicationExit(object sender, EventArgs e) { Settings.Default.Save(); }