大厨师

修改web.config中的键值

.cs file

{

//Get the configuration information for this web application.

Configuration config =

   WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);

//Make the change.

config.AppSettings.Settings["somekey"].Value = " some value";

//Save all the changes you've made since retrieving the configuration

//infomation.

config.Save()

}

web.config

{

<configuration>

<appSettings>

      <add key="somekey" value="some v value"/>

</appSettings>

<system.web>

     <!-- Configuration settings go here -->

</system.web>

</configuration>

}

posted on 2007-03-27 11:29  大厨师  阅读(366)  评论(0编辑  收藏  举报

导航