<pre> if (PathFileExists(t)) { XmlTextReader^ reader = gcnew XmlTextReader("C:\\Elitron\\Mail\\mail_data.xml"); while (reader->Read()) { switch (reader->NodeType) { case XmlNodeType::Element: // The node is an element. Console::Write("<{0}", reader->Name); while (reader->MoveToNextAttribute()) // Read the attributes. Console::Write(" {0}='{1}'", reader->Name, reader->Value); Console::WriteLine(">"); break; case XmlNodeType::Text: //Display the text in each element. Console::WriteLine(reader->Value); break; case XmlNodeType::EndElement: //Display the end of the element. Console::Write("</{0}", reader->Name); Console::WriteLine(">"); break; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)