XmlTextReader issue
- by Stanislav Palatnik
I'm try to parse this xml, but c# keeps throwing an exception saying it has invalid characters. I can't copy the text from the messagebox directly, so I've screened it.
http://img29.imageshack.us/img29/694/xmler.jpg
Here's the code to get the string
string strRetPage = System.Text.Encoding.GetEncoding(1251).GetString(RecvBytes, 0, bytes);
while (bytes > 0)
{
bytes = socket.Receive(RecvBytes, RecvBytes.Length, 0);
strRetPage = strRetPage + System.Text.Encoding.GetEncoding(1251).GetString(RecvBytes, 0, bytes);
}
int start = strRetPage.IndexOf("<?xml");
string servReply = strRetPage.Substring(start);
servReply = servReply.Trim();
servReply = servReply.Replace("\r", "");
servReply = servReply.Replace("\n", "");
servReply = servReply.Replace("\t", "");
XmlTextReader txtRdr = new XmlTextReader(servReply);