winform自动保存属性变更
1.每次变更都保存
Properties.Settings.Default.PropertyChanged += Default_PropertyChanged; private void Default_PropertyChanged(object sender, PropertyChangedEventArgs e) { Properties.Settings.Default.Save(); }
2. 退出时保存
Application.ApplicationExit += new EventHandler(Application_ApplicationExit); void Application_ApplicationExit(object sender, EventArgs e) { Settings.Default.Save(); }