how to read XML file in C#?
static void Main(string args)
XmlTextReader rdfile = new XmlTextReader("Documents://food.xml");
Console.WriteLine("<" + rdfile.Name);
Console.Write(" " + rdfile.Name + "= '"
+rdfile.Value + " '");
Console.WriteLine(("</" + rdfile.Name + ">"));
im new in XML
why rdfile.read() does not work?
- GardnerLv 79 years agoFavorite Answer
Did you try stepping through the code with the debugger and see what happens or what is actually being read by this routine?Source(s): VB.NET Programmer
- dufreneLv 43 years ago
the only unbelievable respond appeared adequate, although this might develop into fairly not challenge-unfastened in case you desire the employing to allocate the variables in the enter checklist dynamically. at modern, I have not have been given any way of doing this. Sorry i'll't furnish help to from now on than that.
- AnthonyLv 49 years ago
it may be finding the file. either debug and step through the program or put an if statement in to check rdfile != null and go from there.
also, I think XmlDocument.Save(Console.Out) would do what your doing above.. not entirely sure, but there you go