XmlConvert.FromBinHexString Method

NOTE: This API is now obsolete.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

Syntax

'Declaration
<ObsoleteAttribute("This member is not present in the desktop .NET Framework.  Use XmlTextReader.ReadBinHex instead.")> _
Public Shared Function FromBinHexString ( _
    s As String _
) As Byte()
'Usage
Dim s As String 
Dim returnValue As Byte()

returnValue = XmlConvert.FromBinHexString(s)
[ObsoleteAttribute("This member is not present in the desktop .NET Framework.  Use XmlTextReader.ReadBinHex instead.")]
public static byte[] FromBinHexString(
    string s
)
[ObsoleteAttribute(L"This member is not present in the desktop .NET Framework.  Use XmlTextReader.ReadBinHex instead.")]
public:
static array<unsigned char>^ FromBinHexString(
    String^ s
)
public static function FromBinHexString(
    s : String
) : byte[]

Parameters

Return Value

Type: array<System.Byte[]

Remarks

Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows CE Platform Note: This member is obsolete on the .NET Compact Framework 3.5 and later versions. To workaround this issue, use the following code example:

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("xmldocument.xml");
XmlNode xmlNode = xmlDoc.SelectSingleNode("/data");
XmlTextReader reader = new XmlTextReader(new StringReader(xmlNode.OuterXml));
reader.MoveToContent();
do
{
    byte[] buffer = new byte[1024];
    int bytes = reader.ReadBinHex(buffer, 0, buffer.Length);
    string data = new string(Encoding.UTF8.GetChars(buffer, 0, bytes));
    Console.WriteLine(data);
} while (reader.Name == "data");

Platforms

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0, 1.0
Obsolete (compiler warning) in 3.5

XNA Framework

Supported in: 1.0
Obsolete (compiler warning) in 3.0
Obsolete (compiler warning) in 2.0

See Also

Reference

XmlConvert Class

XmlConvert Members

System.Xml Namespace