I have been trying for the past few hours, with little to no success, to read from a .xml file.
I tried:
XmlReader reader = XmlReader.Create("ChampionList.xml");
reader.ReadToFollowing("Name");
reader.MoveToFirstAttribute();
string nume = reader.Value;
MessageBox.Show(nume);
My xml looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<main>
<Champion>
<Name>Aatrox</Name>
<Counter>Soraka</Counter>
</Champion>
<Champion>
<Name>Ahri</Name>
<Counter>Diana</Counter>
</Champion>
</main>
I would like to read the name and the counter whenever I press the button. Each time a new one (1st button press - 1st champ and so on).
Can someone help me? Also, a bit of an explanation of the code would be nice, if there are many loops and stuff, I still have much to learn.