Home >
Code >
C#
>
Dynamically change the web.config file key value using C#.net
Dynamically change the web.config file key value using C#.net
by
Narain_Siddharth
on
Dec 14, 2011
Category:
C#
|
Views:
155
|
Points:
25
|
Silver ★
|
|
|
The below sample C# code shows how to change the key value of appsettings in the web.config file dynamically.
web.config file settings
<appSettings> <add key="Time" value="10" /> </appSettings> Namespace details
using System.Web.Configuration; using System.Configuration; code
Configuration AppConfigSettings = WebConfigurationManager.OpenWebConfiguration("~"); AppConfigSettings.AppSettings.Settings["Time"].Value = "10"; AppConfigSettings.Save();
|
Like this code? Bookmark and Share:
|
|
|
|
No Response found!
|
|
|
|
|