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 阅读(179)
评论(0) 编辑 收藏