473,480 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ConfigurationSettings.AppSettings.Set question

Hi

If I use ConfigurationSettings.AppSettings.Set("KeyName", "KeyValue"), where
does the KeyName/KeyValue combination ends up? In a file? In windows
registry?

Thanks

Regards
May 12 '07 #1
3 3243
ConfigurationSettings.AppSettings is a sort of read-only collection. Even
though you can still call Set() method the key/value exists only for the
life-time of the web app. That is, if you restart the web app, the set
key/value wont exist.

BTW, this read-only collection gets populated from web.config's
<appSettingssection.

Also, note that ConfigurationSettings.AppSettings is obsolete in .NET 2+. It
has been replaced by System.Configuration.ConfigurationManager.AppSetti ngs (
in system.configuration assembly).
"John" wrote:
Hi

If I use ConfigurationSettings.AppSettings.Set("KeyName", "KeyValue"), where
does the KeyName/KeyValue combination ends up? In a file? In windows
registry?

Thanks

Regards
May 12 '07 #2
John, do yourself & everyone else a favor & create an ini file in your app's
directory & leave the registry etc alone. I hate waiting for windows to
process a bloated registry of deleted or non existant app entries. VB 1.0
did get one thing right. Leave your stuff out of the system directory too.
Thanks



"John" <Jo**@nospam.infovis.co.ukwrote in message
news:ua**************@TK2MSFTNGP03.phx.gbl...
Hi

If I use ConfigurationSettings.AppSettings.Set("KeyName", "KeyValue"),
where does the KeyName/KeyValue combination ends up? In a file? In windows
registry?

Thanks

Regards

May 13 '07 #3
On May 13, 3:38 am, "Smitty" <iasm9222...@yahoo.comwrote:
John, do yourself & everyone else a favor & create an ini file in your app's
directory & leave the registry etc alone. I hate waiting for windows to
process a bloated registry of deleted or non existant app entries. VB 1.0
did get one thing right. Leave your stuff out of the system directory too.
I agree with the registry advice, but the advice to use an .ini file
in the app's folder is not as sound. Windows Vista may not allow your
program access to the program's folder. There is a "Program Data"
folder, I believe, that is used for that purpose, or you could use the
user's documents folder for that purpose. So if your app target's
Windows Vista, keep this in mind.

Chris

May 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2432
by: Rob Mayo | last post by:
I'm developing a server control for our intranet. This control is only going to be used in two applications on the server, but they must be separate. It has been established that these 2 apps...
1
1402
by: [myfirstname] | last post by:
Hello I've seen several examples around the web where people put all the values in ConfigurationSettings.AppSettings into Application State variables in global.asax, like this: foreach...
3
1526
by: Random | last post by:
I'm writing a class library for my web app data access, but don't want to hard code the database connection string in the class. Nor do I want to pass the connection string in from the web app...
1
1885
by: Brad Wood | last post by:
I have a 1.1 web service that creates multiple threads and makes an http call within each thread. When many threads are created, the service fails every on other call with one of these 2 errors: ...
4
2335
by: RSH | last post by:
Hi, I have a situation where I am attempting to print the contents of an AppSettings property in the aspx file of my website. Basically here is the code I am using: <% Response.Write("Email:"...
1
2726
by: Jenny | last post by:
Hello, I read my applications App.Config file using ConfigurationSettings.AppSettings When I try to check it's last access write time using File.GetLastWriteTime and the refresh new data...
8
2621
by: Mark | last post by:
Could someone provide me with details or a link on how the line of code executes underneath the hood? Assume it's executed in an ASP.NET application. string blah =...
3
3282
by: John | last post by:
Hi If I use ConfigurationSettings.AppSettings.Set("KeyName", "KeyValue"), where does the KeyName/KeyValue combination ends up? In a file? In windows registry? Thanks Regards
1
5798
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add...
2
5315
by: mark4asp | last post by:
In trying to get the C# conversion code for Head First Design Patterns to work I came accross a number of warnings. e.g. Warning Number: 10 Description: ...
0
7032
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,...
0
7076
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...
0
6873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5321
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,...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
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...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.