C#技术百科
问问你的心你有没有信心 做事情要专一坚定,执着

 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

posted on 2008-06-25 22:54  王德田  阅读(179)  评论(0编辑  收藏  举报