Tema: xml y c#
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/04/2008, 12:43
dark_nexus
 
Fecha de Ingreso: octubre-2007
Ubicación: Berlin
Mensajes: 51
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: xml y c#

Código:
public void leerXML()
        {
            string ele = "";
          

            XmlTextReader reader = new XmlTextReader("ratios.xml") ;

         
            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element: 

                        //MessageBox.Show(reader.Name);
                        ele = reader.Name;
                        break;

                    case XmlNodeType.Text: 

                        if (ele == "Elemento")
                        {
                           
                            //cargarXML(reader.Value, ele);
                        }
                        if (ele == "Clase")
                        {
                            
                            
                            //cargarXML(reader.Value, ele);
                        }
                        if (ele == "basico")
                        {
                            
                           
                            //cargarXML(reader.Value, ele);
                        }
                        break;
                }
            }
            
         
        }
Código:
public void cargarXML(string cant, string material)
        {
           /* Form1 f = new Form1();
            if (material == "Elemento")
            {
                //MessageBox.Show(cant + " " + material);
                f.Tbox_rametal.Text = cant;
            }
           
            */
        }