Dim id As Integer = 3
Dim doc As New XmlDocument()
doc.Load("usuarios.xml")
Dim str As String = "/Usuarios/Usuario[id=" & id & "]"
Dim del As XmlElement = doc.SelectSingleNode("/Usuarios/Usuario[id=" & id & "]")
If Not del Is Nothing Then
del.ParentNode.RemoveChild(del)
End If
Dim settings As New XmlWriterSettings()
settings.Indent = True
Dim wout As XmlWriter = XmlWriter.Create("usuarios.xml", settings)
doc.Save(wout)
wout.Close()
No hay comentarios.:
Publicar un comentario