XmlConvert.ToBinHexString 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 XmlTextWriter.WriteBinHex instead.")> _
Public Shared Function ToBinHexString ( _
inArray As Byte() _
) As String
'Usage
Dim inArray As Byte()
Dim returnValue As String
returnValue = XmlConvert.ToBinHexString(inArray)
[ObsoleteAttribute("This member is not present in the desktop .NET Framework. Use XmlTextWriter.WriteBinHex instead.")]
public static string ToBinHexString(
byte[] inArray
)
[ObsoleteAttribute(L"This member is not present in the desktop .NET Framework. Use XmlTextWriter.WriteBinHex instead.")]
public:
static String^ ToBinHexString(
array<unsigned char>^ inArray
)
public static function ToBinHexString(
inArray : byte[]
) : String
Parameters
- inArray
Type: array<System.Byte[]
Return Value
Type: System.String
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:
byte[] buffer = new byte[1024];
int readBytes = 0;
using (XmlWriter writer = XmlTextWriter.Create("xmldocument.xml"))
{
FileStream inputFile = new FileStream(@"C:\data.dat", FileMode.Open);
writer.WriteStartDocument();
writer.WriteStartElement("data");
BinaryReader br = new BinaryReader(inputFile);
Console.WriteLine("\r\nWriting BinHex data...");
do
{
readBytes = br.Read(buffer, 0, buffer.Length);
writer.WriteBinHex(buffer, 0, readBytes);
} while (buffer.Length <= readBytes);
br.Close();
writer.WriteEndElement();// </data>
writer.WriteEndDocument();
}
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