Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Xml;
- namespace WindowsFormsApp1
- {
- /*
- XmlDocument midocxml = new XmlDocument();
- midocxml.Load(@"c:\milista.xml");
- XmlNodeList personas = midocxml.GetElementsByTagName("personas");
- XmlNodeList lista = ((XmlElement)personas[0]).GetElementsByTagName("persona");
- foreach (XmlElement nodo in lista)
- XmlNodeList nNombre = nodo.GetElementsByTagName("nombre");
- XmlNodeList nApellido1 = nodo.GetElementsByTagName("apellido1");
- XmlNodeList nApellido2 = nodo.GetElementsByTagName("apellido2");
- XmlNodeList nTelefono = nodo.GetElementsByTagName("telefono");
- XmlNodeList nEmail = nodo.GetElementsByTagName("email");
- */
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- XmlDocument XmlDocument = new XmlDocument();
- object midocxml = null;
- midocxml.Load("milista.xml");
- XmlNodeList personas = midocxml.GetElementsByTagName("personas");
- XmlNodeList lista = ((XmlElement)personas[0]).GetElementsByTagName("persona");
- foreach (XmlElement nodo in lista)
- XmlNodeList nNombre = nodo.GetElementsByTagName("nombre");
- XmlNodeList nApellido1 = nodo.GetElementsByTagName("apellido1");
- XmlNodeList nApellido2 = nodo.GetElementsByTagName("apellido2");
- XmlNodeList nTelefono = nodo.GetElementsByTagName("telefono");
- XmlNodeList nEmail = nodo.GetElementsByTagName("email");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement