Mega Code Archive

 
Categories / VB.Net Tutorial / Data Type
 

Converts the bit patterns of UInt32 values to Byte arrays with the GetBytes method

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