Hello,
In my past XML Problem i got a good response. But i have also a little bit problem.
I have a XML File like this :
<Start>
<Apple>
<String>A</String>
</Apple>
<Banana>
<String>B</String>
</Banana>
<JackFruit>
<String>C</String>
</JackFruit>
</Start>
I can read all section name like - Apple,Banana,JackFruit by using this code :
using (XmlReader reader = XmlReader.Create(@"D:\\file.xml"))
{
while (reader.Read())
{
if (reader.IsStartElement())
{
switch (reader.Name.ToString())
{
case "Start":
Console.WriteLine("Name of the Element is : " + reader.ReadString());
}
}
}
But how to do same thing if my xml file format is :
="1.0"="utf-8"
<Start>
<CodeProject Code="APPLE">
<String>A</String>
</CodeProject>
<CodeProject Code="Banana">
<String>B</String>
</CodeProject>
<CodeProject Code="JackFruit">
<String>C</String>
</CodeProject>
</Start>
I would like to read all section names and add all section names on listbox1.
Have anyone idea how can i do this easily ?
Thanks in advanced.