i have xml what i get as byte array, whats the best way to get the xml string out of it? I was tryng to use xmltextreader and memorystream but with no success..
XmlDocument doc = new XmlDocument(); string xml = Encoding.UTF8.GetString(buffer); doc.LoadXml(xml);
OR
XmlDocument doc = new XmlDocument(); MemoryStream ms = new MemoryStream(buffer); doc.Load(ms);
This assumes your data has UTF8 encoding which is the usual for XML. Also buffer
here is the byte array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With