// add system
using System.Xml

private void button2_Click(object sender, EventArgs e)
{
    XmlTextReader reader = new XmlTextReader("savefile.xml");
    XmlNodeType type;

    while (reader.Read())
       {
           type = reader.NodeType;

           if (type == XmlNodeType.Element)
              {
                  if (reader.Name == "Title")
                     {
                         reader.Read();
                         textBox1.Text = reader.Value;
                     }

                  if (reader.Name == "Item")
                     {
                         reader.Read();
                         listBox1.Items.Add(reader.Value);
                     }
              }
       }

       reader.Close();
}

Leave a Reply