byte[] bytesData = Encoding.Default.GetBytes(_myXmlInStringFormat);
MemoryStream memoryStream = new MemoryStream(bytesData);
using (XmlReader xmlReader = XmlReader.Create(memoryStream))
{
xmlReader.ReadToFollowing("Foo");
_foo = xmlReader.ReadElementContentAsString("Foo", "");
if (xmlReader.ReadToFollowing("Bar"))
{
_bar = xmlReader.ReadElementContentAsString("Bar", "");
}
}
No comments:
Post a Comment