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


          文章來(lái)源:http://www.cnblogs.com/wangdetian168/archive/2008/06/25/1229996.html
          posted on 2010-09-28 11:00 sanmao 閱讀(183) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           

          常用鏈接

          留言簿(5)

          隨筆分類(lèi)

          隨筆檔案

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 当涂县| 静海县| 辽阳县| 齐河县| 乐清市| 青河县| 泰州市| 元谋县| 屏东县| 本溪市| 德庆县| 岫岩| 忻州市| 监利县| 全南县| 赣州市| 兴化市| 如皋市| 射阳县| 普洱| 措勤县| 荆州市| 杨浦区| 合水县| 札达县| 绩溪县| 永年县| 衡阳市| 稻城县| 壤塘县| 凉城县| 南溪县| 沧源| 栾川县| 玉林市| 石景山区| 阿拉善右旗| 海伦市| 陆河县| 武鸣县| 永胜县|