>> I used the settings class that VS.NET automatically generates to save
>> some app settings, simply because it is the easiest way. But the
[quoted text clipped - 7 lines]
>have to create my own way to save and load settings instead of using
>VS.NET's built-in settings architecture? Please give me any advice.
Have a look at ApplicationSettingsBase.Upgrade()
http://msdn2.microsoft.com/en-us/library/system.configuration.applicationsetting
sbase.upgrade.aspx
Rob
Sin Jeong-hun - 18 Mar 2008 22:17 GMT
On Mar 15, 12:40 am, "Rob Lancaster" <robert.lancaste...@ntlworld.com>
wrote:
> >> I used the settings class that VS.NET automatically generates to save
> >> some app settings, simply because it is the easiest way. But the
[quoted text clipped - 13 lines]
>
> Rob
Thank you. I guess Upgrade() should be called once the version has
chaged, and there seems to be no way to get whether the settings file
for this version of the application is just created or not (i.e. first
run), I added an entry "FirstRun" with default value = true and added
the following code at the beginning of the application.
if (Properties.Settings.Default.FirstRun)
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.FirstRun = false;
}
Now everything seems to work as I expected.