CSharp/C# >> RE: Application setting not being saved... Duh - I just kicked myself

by UmF5IE1pdGNoZWxs » Sat, 06 Sep 2008 16:46:02 GMT



"Ray Mitchell" wrote:

> Hello,
>
> I've done this type of thing many times before so I know it works, but for
> some reason it's not working in this particular application.
>
> In an event handler I save some values into the application settings, such as:
>
> Settings.Default.host = some value;
> Settings.Default.port = some value;
> Settings.Default.userName = some value;
> Settings.Default.password = some value;
> Settings.Default.remoteDirectory = some value;
>
> As long as I don't close the application I can recall the values I stored in
> the settings by doing something like:
>
> something = Settings.Default.host;
> something = Settings.Default.port;
> something = Settings.Default.userName;
> something = Settings.Default.password;
> something = Settings.Default.remoteDirectory;
>
> However, once I close the application and restart it, all the values in
> Settings.Default are lost.
>
> Any ideas?
>
> Thanks,
> Ray
>
>

It's late and I'm careless. Obviously I left out Settings.Default.Save();
Sorry!