添加
dim xmldoc as xmldocument=new xmldocument()
xmldoc.load(server.mappath("message.xml"))
dim root as xmlnode=xmldoc.selectsinglenode("NewDataSet")
dim child1 as xmlelement=xmldoc.createelement("tables")
dim child2 as xmlelement=xmldoc.createelement("id")
child2.innertext=dr.getint32(0).tostring
child1.appendchild(child2)
删除
dim xmldoc as xmldocument=new xmldocument()
xmldoc.load(server.mappath("message.xml"))
dim root as xmlnode=xmldoc.selectsinglenode("/NewDataSet/tables[id='" & noteid & "']")
root.parentnode.removechild(root)
xmldoc.save(server.mappath("message.xml"))