Home > Backend Development > C#.Net Tutorial > Easily process XML data in .NET Framework (4-4)

Easily process XML data in .NET Framework (4-4)

黄舟
Release: 2016-12-20 14:16:59
Original
1544 people have browsed it

??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)!




Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template