保存Properties.Settings时出现问题
问题描述:
嗨专家
我正在使用代码来保存我的设置(在类库中),没有任何例外,但是我的设置从未更改.
我该怎么办才能解决问题?
hi experts
I''m using the code for saving my settings (in Class Library) not any exceptions but my Settings never change.
What can I do for solve the problem?
Properties.Settings.Default.ProgramTitle = head;
Properties.Settings.Default.PageTitle= title;
Properties.Settings.Default.MaxItemsForShowing = maxItems;
Properties.Settings.Default.MinItemsForShowing = minItems;
Properties.Settings.Default.Save();
它们的范围是用户".
Their scope are "User"
答
如果这些是用户设置,则它们不在您的应用程序配置文件中,而是在其他位置.如果要重新启动应用程序并再次获取值,则应该看到新值.请检查这些设置是否确实是用户设置,因为无法在运行时更改应用程序设置.
If these are user settings then they are not writing in your application config file but elsewhere. If you were to restart the application and fetch the values again you should see the new values. Check that these setting are indeed user settings because application settings cannot be changed at runtime.
请参阅此链接并检查您的代码.
http://blog.csharphelper. com/2009/12/09/save-and-restore-settings-in-c.aspx
Refer to this Link and Check your code.
http://blog.csharphelper.com/2009/12/09/save-and-restore-settings-in-c.aspx