Mega Code Archive

 
Categories / VB.Net / Development
 

BitConverter GetBytes (UInt16) returns 16-bit unsigned integer value as an array of bytes

Imports System Imports Microsoft.VisualBasic Module GetBytesUInt16Demo     Sub GetBytesUInt16( argument As UInt16 )         Dim byteArray As Byte( ) = BitConverter.GetBytes( argument )         Console.WriteLine(BitConverter.ToString( byteArray ) )     End Sub      Sub Main( )         GetBytesUInt16( Convert.ToUInt16( 15 ) )     End Sub  End Module