Home > Article > Backend Development > Easily process XML data in .NET Framework (4-4)
??Figure 9 String Array in Internet Explorer
??The Reader class has special methods for explaining Base64 and BinHex encoding streams. The following code snippet demonstrates how to use the ReadBase64 method of the XmlTextReader class to parse a document created with the Base64 and BinHex encoding sets.
XmlTextReader reader = new
int n = reader.ReadBase64(bytes, 0, 1000);
string buf = Encoding.Unicode.GetString(bytes);
Console.WriteLine(buf.Substring(0,n));
}
}
reader.Close();
?? Conversion from byte type to string type is achieved through the GetString method of the Encoding class. Although I only introduced the code based on the Base64 encoding set, you can simply replace the method name with BinHex to read the node content based on BinHex encoding (using the ReadBinHex method). This technique can also be used to read any binary data expressed in byte data form, especially image type data.
The above is the content of easily processing XML data (4-4) in .NET Framework. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!