Example of the BitConverter.GetBytes( UInt32 ) method. : BitConverter « Development « VB.Net Tutorial






Imports System
Imports Microsoft.VisualBasic

Module GetBytesUInt32Demo
    Sub GetBytesUInt32( argument As UInt32 )
        Dim byteArray As Byte( ) = BitConverter.GetBytes( argument )
        Console.WriteLine( BitConverter.ToString( byteArray ) )
    End Sub 

    Sub Main( )
        GetBytesUInt32( Convert.ToUInt32( 15 ) )
        GetBytesUInt32( Convert.ToUInt32( &H100000 ) )
        GetBytesUInt32( Convert.ToUInt32( Int32.MaxValue ) )
    End Sub 
End Module








7.35.BitConverter
7.35.1.Convert Byte arrays to String objects with the ToString method.
7.35.2.Example of the BitConverter.ToString( Byte( ) ) method.
7.35.3.Example of the BitConverter.GetBytes( UInt32 ) method.