it is a xml file, you can modify it through classes in System.Xml, but be warned, by modifying web.config, the web app will be restarted and your state information will be lost<%@ Import Namespace="System.Xml" %>
<script language="C#" runat="server">
void Page_Load(Object o, EventArgs e)
{
string sFile = Server.MapPath("web.config");
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(sFile);
XmlNode node = xmldoc.SelectSingleNode("//add");
if (node != null)
node.Attributes["value"].Value = "123";
xmldoc.Save(sFile);
}
</script>
<script language="C#" runat="server">
void Page_Load(Object o, EventArgs e)
{
string sFile = Server.MapPath("web.config");
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(sFile);
XmlNode node = xmldoc.SelectSingleNode("//add");
if (node != null)
node.Attributes["value"].Value = "123";
xmldoc.Save(sFile);
}
</script>
解决方案 »
- 数据库读取?麻烦大家帮帮忙?
- ASP.NET后台控制【TextBox】 的高度
- 如何将数据库读取的string转化成Html
- 求一sql高手来帮帮小弟啊
- 字符串截取问题,请大家帮忙?
- 小弟用css给button(服务器端控件)增加背景图片 结果css的别的属性都能表现出来,就是图片显示不了
- 当datagrid绑定的表无记录的时候,datagrid页眉的高度怎么会拉长,怎样让页眉高度和有绑定数据的高度一样呢?
- datalist限定字数的问题。
- 请教--增加新数据到数据库所产生的错误。
- 页面画图的问题?
- 一般大家开发Web程序使用n层结构么?
- Asp.net中Calendar是个月历,上下翻年太不方便,有没有第三方好用些的年历?
在安装的时候是可以的