?? Figure 9 String Array in Internet Explorer
?? The reader class has a special method for explaining BASE64 and BinHex encoded streams. The following code snippet demonstrates how to parse a document created with the BASE64 and BinHex encoding sets using the ReadBase64 method of the XmlTextReader class.
XmlTextReader reader = new XmlTextReader (filename);
while (reader. Read ()) {
if (reader. LocalName = = ' element ') {
byte[] bytes = new byte[1000];
int n = reader. ReadBase64 (bytes, 0, 1000);
String buf = Encoding.Unicode.GetString (bytes);
Console.WriteLine (BUF. Substring (0,n));
}
}
Reader. Close ();
?? The conversion from byte to string is accomplished by the GetString method of the Encoding class. Although I only allow the code based on the BASE64 encoding set, but can be abbreviated with the BinHex Exchange method name can be read based on BinHex encoded node content (using the ReadBinHex method). This technique can also be used to read any binary data that behaves in byte data, especially the image type.
The above is the easy processing of XML data (4-4) in the. NET framework, and more about topic.alibabacloud.com (www.php.cn)!