XmlDocument xdc = new XmlDocument();
  xdc.Load(Server.MapPath("Web.config"));
     XmlNode root = xdc.SelectSingleNode("configuration/appSettings/add");
  XmlElement xe = root as XmlElement;
  xe.SetAttribute("value","server=.;database=pubs;user id=sa;password=");
   xe.InnerText="tesstadd";
   xdc.Save(Server.MapPath("Web.config"));
  Response.Write(xe.GetAttribute("key")); 

 

    Dim xdc As XmlDocument = New XmlDocument
        xdc.Load(Request.PhysicalApplicationPath + ("web.xml"))
        Dim xn As XmlNode = xdc.SelectSingleNode("root/config/pc")
        Dim xe As XmlElement = CType(xn, XmlElement)
        xe.GetAttribute("name")
        xe.GetAttribute("ip")
        xe.GetAttribute("open")
        Dim ip As String = xe.GetAttribute("ip")
        Dim open As String = xe.GetAttribute("open")
        If open = "yes" Then
        Else
            Response.Redirect(Request.Url.ToString())
        End If


文章来源:http://www.cnblogs.com/wangdetian168/archive/2008/06/25/1229996.html
posted on 2010-09-28 11:00 sanmao 阅读(137) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

常用链接

留言簿(5)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜