Hi guys, My C# programming is quite basic, and i would like to note, i have tried a few tutorials on reading XML and creating my program. i have done as much as i can understand so far, and so i am hoping someone could maybe explain to me how to go about doing this part.
my program is quite more complicated than this but i am only after the basics, so i can then progress on it my self, i want to try and learn this as best i can :) i have tried using MSDN and other sites but its just bouncing in and out of my head.
1)I am reading a file and storing the data into a string.
2)I have an XML file (atm with only a few things but will be expanded!) the XML file contains the below data:
<?xml version="1.0"?> <References> <sports> <Ref type = "football">11 man team</Ref> <Ref type = "tennis">40 love</Ref> <Ref type = "cricket">hit a 6</Ref> </sports> <games> <Ref type = "monopoly">take £200</Ref> <Ref type = "CS">counter terrorists</Ref> <Ref type = "fallout">collect caps</Ref> </games> </References>
now, as you can see from the XML File, I have Sports and Games. Eventually this will be expanded to a wider ranger of things.
in each section i have stuff relating to these, such as for sports, i have football, tennis, cricket.
each one of these has some text.
my program has 2 listboxes at the moment, 1 for Sports and 1 for Games.
What i want to do:
I want to take the string that I took from a file, then check the XML file. for example, if the string i have says "each team in football has an 11 man team" it will check through each line in the XML and see that it contains "11 man team" which is for football. it then takes the file name, and lists it into the Sports listbox. when the user clicks on the file name (e.g. bubb.txt) it will display in a text box "Football".
This is very basic compared to what i want it to do, its more of a starting point that i feel i can work with and expand on in a much more complex way.
i appreciate any help you guys may be able to provide me.