473,545 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ConfigurationSe ttings.AppSetti ngs.Set question

Hi

If I use ConfigurationSe ttings.AppSetti ngs.Set("KeyNam e", "KeyValue") , where
does the KeyName/KeyValue combination ends up? In a file? In windows
registry?

Thanks

Regards
May 12 '07 #1
3 3247
ConfigurationSe ttings.AppSetti ngs 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
<appSettingssec tion.

Also, note that ConfigurationSe ttings.AppSetti ngs is obsolete in .NET 2+. It
has been replaced by System.Configur ation.Configura tionManager.App Settings (
in system.configur ation assembly).
"John" wrote:
Hi

If I use ConfigurationSe ttings.AppSetti ngs.Set("KeyNam e", "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.in fovis.co.ukwrot e in message
news:ua******** ******@TK2MSFTN GP03.phx.gbl...
Hi

If I use ConfigurationSe ttings.AppSetti ngs.Set("KeyNam e", "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...@ya hoo.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
2440
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 will use a specifically named key from their respective web.config's. I want the control to use that key regardless of which application it's being...
1
1412
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 (string key in ConfigurationSettings.AppSettings.Keys) { Application = ConfigurationSettings.AppSettings; }
3
1536
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 every time I access it. I want to define the connection string in the web app ConfigurationSettings and let the class library reference it itself...
1
1896
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: (1) Parser Error Message: </b>The XML file c:\windows\microsoft.net\framework\v1.1.4322\Config\machine.config could not be loaded. Attempted to...
4
2352
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:" & System.Configuration.ConfigurationSettings.AppSettings.Get("WebMasterEmail") ) %> The Email part of the string prints out but not the...
1
2731
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 from App.Config using ConfigurationSettings.AppSettings
8
2629
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 = ConfigurationSettings.AppSettings Once your application has called for the "foo" key once, how expensive is to call the same line again? My gut tells me that the CLR likely...
3
3286
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
5807
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 key="company" value="Hyundai" /> <add key="Hyundai" value="sonata" />
2
5318
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: 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by...
0
7496
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
7685
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. ...
1
7452
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7784
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5354
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
5071
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3485
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...
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
738
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.