在需要严重重新分解的桌面应用程序中,我有几个代码块,如下所示:
private void LoadSettings() { WindowState = Properties.Settings.Default.WindowState; Location = Properties.Settings.Default.WindowLocation; ... } private void SaveSettings() { Properties.Settings.Default.WindowState = WindowState; Properties.Settings.Default.WindowLocation = Location; ... }
什么是替代这个的最佳方法?项目施加的限制:
> Visual Studio 2005
> C#/ .NET 2.0
> Windows窗体
更新
感谢Tundey,看起来像去的路.对于后代,我还发现了两个有用的教程:“Windows Forms User Settings in C#”和“Exploring Secrets of Persistent Application Settings”.