473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How does ConfigurationManager.AppSettings.Set stores values?

Hello everybody,
you can use ConfigurationManager.AppSettings.Set method
(ConfigurationManager is in System.Web.Configuration namespace) to store a
modified value from web.config.
To be practical, you define a custom key in web.config:

<appSettings>
<add key="ReportButtonClick" value="0" />
</appSettings>

retrieve value of the key with Get method:

counter = ConfigurationManager.AppSettings.Get("ReportButton Click")

modify this value:

counter = counter + 1

and write it back with Set method:

ConfigurationManager.AppSettings.Set("ReportButton Click", counter)

If I access back value with Get method, I find modified value but, of
course, web.config is NOT modified.
Where does Set method stores property's value?
Mar 5 '06 #1
3 10692
Cache

--
Terry Burns
http://TrainingOn.net
"natasha" <na*****@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
Hello everybody,
you can use ConfigurationManager.AppSettings.Set method
(ConfigurationManager is in System.Web.Configuration namespace) to store a
modified value from web.config.
To be practical, you define a custom key in web.config:

<appSettings>
<add key="ReportButtonClick" value="0" />
</appSettings>

retrieve value of the key with Get method:

counter = ConfigurationManager.AppSettings.Get("ReportButton Click")

modify this value:

counter = counter + 1

and write it back with Set method:

ConfigurationManager.AppSettings.Set("ReportButton Click", counter)

If I access back value with Get method, I find modified value but, of
course, web.config is NOT modified.
Where does Set method stores property's value?

Mar 6 '06 #2
Cache


Good answer, Terry, but I'm not so comfortable about caching in ASP.NET :)
How do examine cache for my application?
And, is using cache scalable to million of users?

P.S.: a little question: I'd like to download newsgroup in OE. What is NNTP
Server? Does it require authentication? If so, do I have and type my Passport
credentials?
Mar 6 '06 #3
re:
I'd like to download newsgroup in OE. What is NNTP Server?
msnews.microsoft.com

re: Does it require authentication?
No, it does not.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"natasha" <na*****@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
Cache


Good answer, Terry, but I'm not so comfortable about caching in ASP.NET :)
How do examine cache for my application?
And, is using cache scalable to million of users?

P.S.: a little question: I'd like to download newsgroup in OE. What is NNTP
Server? Does it require authentication? If so, do I have and type my Passport
credentials?

Mar 6 '06 #4

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

Similar topics

1
by: Richard Golebiowski | last post by:
I have been trying to figure this out for quite some time and cannot find any examples in VB.Net or in VB that work correctly. I am working on an application where I want the user to be able to...
3
by: studen77 | last post by:
I'm not comprehending how C# assigns indexes to items you add to a SortedList item. Here's some example code: sl.Add ("first_item","First Item"); sl.Add ("second_item", "Second Item"); sl.Add...
2
by: Peter Kirk | last post by:
Hi there is there any way to tell what .config file the property System.Configuration.ConfigurationManager.AppSettings is trying to access? I have a class which uses this property but no...
4
by: Jim in Arizona | last post by:
I've been using VB 2005 for a few years now. My entire coding history is VB related. This weekend I decided to start learning C#. I'm at work now and decided to do some coding in C# that I would...
1
by: sandy.82in | last post by:
Hi I'm new to C# , I'm using VS2005 and .NET2.0 .Here is my issue i just developed a simple application with app.config , and a simple class library and following is my app.configfile <?xml...
2
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi! I'm developing for many years, by i have never encountered such problem in VC++! I tried doing the simplest test: Create new solution -Win32 project... In the main procedure I wrote...
1
by: Fred Chateau | last post by:
Visual Studio is telling me that ConfigurationSettings.AppSettings.Get() is obsolete, but I cannot get ConfigurationManager to show up in Intellisense. Any idea what I'm doing wrong? --...
2
by: Thomas Bauer | last post by:
Hello, I have a config file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="Directory" value="C:\_Database\" /> <add key="CloseApplication" value="0" />...
1
by: Soumya Mukherje | last post by:
I am facing an amazing problem in ASP.NET. I have a website with many sub directories. The sub directories have aspx and aspx.cs files but do not contain web.config files. I am using the web.config...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.