471,317 Members | 1,514 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

Application Settings in VS2005... Anyone get this to work or knowa good site with an up--to-date tutorial?

Jim
I'm trying to use the Application Settings option in VS2005 with C#. So
far I've no success getting my settings to save or load. Various
tutorials on the 'net seem to be outdated.

Even MSDN's info seems to be incorrect regarding the act of accessing
saved settings. They say a "Settings" object is used to access them but
I have no access to such an object (It's called My.Settings in vb).

Anyone know the low-down on this? Any helpful tutorials?

Thanks for any help.
Dec 18 '05 #1
2 4533
I did something like this, but for user settings (not application since
they should be read only).

private void SaveSettings()
{
<ProjectName>.Properties.Settings userSettings = new
<ProjectName>.Properties.Settings();

userSettings.<NameOfSetting> = "This really blows my mind!!";

userSettings.Save();
}

When reading the setting, do the same as above, but read :) I found
that a user.config file gets stored in C:\Documents and
Settings\<userName>\Local settings\Application Data\Company Name (from
assembly info?)\<Project Name>_Weird looking key

Hope this helps. I'm very new to this :)

Dec 19 '05 #2
In c# use Properties such as Properties.Settings.Default.ConnectionString;
"Jim" <mr**********@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
I'm trying to use the Application Settings option in VS2005 with C#. So
far I've no success getting my settings to save or load. Various tutorials
on the 'net seem to be outdated.

Even MSDN's info seems to be incorrect regarding the act of accessing
saved settings. They say a "Settings" object is used to access them but I
have no access to such an object (It's called My.Settings in vb).

Anyone know the low-down on this? Any helpful tutorials?

Thanks for any help.

Dec 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by djmc | last post: by
1 post views Thread by Cristian | last post: by
2 posts views Thread by Sin Jeong-hun | last post: by
11 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post: by
3 posts views Thread by John | last post: by
3 posts views Thread by =?Utf-8?B?RWQgQ29oZW4=?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.