How to read a XML format file to memory in C#?

Posted by Nano HE on Stack Overflow See other posts from Stack Overflow or by Nano HE
Published on 2010-03-19T07:25:47Z Indexed on 2010/03/19 7:31 UTC
Read the original article Hit count: 184

Filed under:
|

// .net 2.0 and vs2005 used. I find some code below. I am not sure I can extended the sample code or not? thank you.

if (radioButton.Checked)
            {
                MemoryStream ms=new MemoryStream();
                byte[] data=ASCIIEncoding.ASCII.GetBytes(textBox1.Text);
                ms.Write(data,0,data.Length);
                reader = new XmlTextReader(ms);
                //some procesing code
                ms.Close();
                reader.Close();
            }

BTW, Could you please help me to do some dissection about the line below.

byte[] data=ASCIIEncoding.ASCII.GetBytes(textBox1.Text);

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml