bombero_7 Posted September 3, 2013 Report Share Posted September 3, 2013 (edited) la estructura de mi archivo xml es dim dirip as stringdim imagen as string <?xml version="1.0" encoding="UTF-8"?><datos> <ip id="127.0.0.1" img="c:\visual\byn.bmp"/> </datos> tengo el siguiente codigo para leer un archivo XML Xml = New XmlDocument() Xml.Load(System.AppDomain.CurrentDomain.BaseDirectory() & "config.xml") NodeList = Xml.SelectNodes("/datos/ip") For Each Node In NodeList With Node.Attributes dirip = (.GetNamedItem("id").Value) imagen = (.GetNamedItem("img").Value) End With Next puedo leer mis items "id" y "img" sin problemas ahora lo que quiero es poder modificar esos campos del archivo y ese es mi problema , he leido muchos codigos distintos y la verdad no me queda claro con ninguno xD me podrian ayudar porfis, estoy pegado en eso nomas Edited September 3, 2013 by bombero_7 Link to comment Share on other sites More sharing options...
The Duke of Quakem Posted September 3, 2013 Report Share Posted September 3, 2013 (edited) Por lo general yo uso los tag y el proceso de lectura/escritura es el mismo, pero a la inversa: TextBox.Text = xml.GetElementsByTagName("Elemento")[0].InnerText; //lee el dato desde el xml xml.GetElementsByTagName("Elemento")[0].InnerText = TextBox.Text; //escribe el dato en el xmlAsumo que para los IDs el proceso debe ser similar. Edited September 3, 2013 by The Duke of Quakem Link to comment Share on other sites More sharing options...
bombero_7 Posted September 6, 2013 Author Report Share Posted September 6, 2013 gracias, lo pondre en practica =) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now