When i try read my xml file it seems to reads it twice and im unsure on how to fix such an error. I thought i can have some sort of loop but im still lost. Any help would be appreciated ty. - It writes the xml file correctly but the duplicate occurs when it reads it.
String workingDir = Directory.GetCurrentDirectory();
XmlTextReader textReader = new XmlTextReader(workingDir + @"\xmldoc.xml");
Console.WriteLine("BaseURI:" + textReader.BaseURI);
textReader.Read();
while (textReader.Read())
{
if (textReader.Name == "test")
{
textReader.Read();
XmlNodeType nType = textReader.NodeType;
if (nType == XmlNodeType.Text)
{
// label.Text = textReader.Value.ToString();
Label l = new Label();
System.Drawing.Point l1 = new System.Drawing.Point(15, 13 + a);
l.Location = l1;
l.Text = textReader.Value.ToString();
a += 20;
}