473,582 Members | 3,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4612
I did something like this, but for user settings (not application since
they should be read only).

private void SaveSettings()
{
<ProjectName>.P roperties.Setti ngs userSettings = new
<ProjectName>.P roperties.Setti ngs();

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

userSettings.Sa ve();
}

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\<userN ame>\Local settings\Applic ation 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.Sett ings.Default.Co nnectionString;
"Jim" <mr**********@y ahoo.com> wrote in message
news:uL******** ******@TK2MSFTN GP12.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1610
by: djmc | last post by:
Hi, Without using a database, what is the best way to store application settings that need to be updated by a webmaster? I would like to provide a configuration screen for the webmasters who use my asp.net application. The application does not use a database so I cannot store values there. Currently, webmasters edit the web.config file to...
1
1877
by: Cristian | last post by:
Hi I have some trouble (on only one developer computer) with the application settings functions... I have posted to the Microsoft.Public.vstudio.setup group but they couldn't help me and asked me to post in this forum. I paste both the messages I posted there.. --- Hi I have just installed VS2005 and the first thing I did was to try out...
5
1393
by: spookyu | last post by:
Alright, I'm sure your tired to hearing this but...does anyone know of any GOOD tutorial's for learning c#. The more basic the better, I have NO experience with programing before this other than what a friend taught me (which is very little). I searched around for a while but every tutorial I found keeps reffering to things that I've never...
6
3617
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a list of all of my webs, however if I attempt to open a site under and web other than localhost I receive the message: "Unable to open the Web...
2
4145
by: Sin Jeong-hun | last post by:
I've read the "How to: Create Application Settings" article (http:// msdn2.microsoft.com/en-us/library/ms171565.aspx) on the MSDN. It looked fine. But this code is only good when all the settings entries are defined at the compile time. And I have to modify the class itself each and everytime I need more entries. So, is it impossible to get/...
0
3994
by: steve | last post by:
I am using vb.net 2005 Express Edition. Application Settings would be a very useful thing, as a global program database that persists; if only it would work! Does anyone know a hack or a work-around to get it working? For me, it seems to mess up the path of the folder where user.config is saved. If I Access the property :--
11
10102
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have seen erratic results. I am aware of one known defect where user classes do not show up in the list of types on the Property/Settings page in the...
3
2481
by: John | last post by:
Hi Is there an easy way to allow user to change application settings at run time short of editing the configuration file manually? Thanks Regards
3
2907
by: =?Utf-8?B?RWQgQ29oZW4=?= | last post by:
I want to utilize the application settings that are provided in VS 2005 Pro AND access them via C#. The examples on line are all in VB.NET. I have looked on-line for the appropriate classes (Settings), but everything is in VB. I have not had any luck. If anyone has done this in C#.NET please post some code that does this. Thank you Ed Cohen
0
7886
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7809
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8312
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1413
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.