Converts the bit patterns of UInt32 values to Byte arrays with the GetBytes method. : Data Type Convert « Data Type « 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








2.45.Data Type Convert
2.45.1.CLng: convert integer to long
2.45.2.CByte: convert to byte
2.45.3.CSng: convert to Single
2.45.4.CDbl: convert to double
2.45.5.CDec: convert to decimal
2.45.6.Call Int64TryParse(String, NumberStyles, IFormatProvider, Int32)
2.45.7.Convert a string into a 64-bit signed integer value using the Int64.Parse(String) method
2.45.8.Convert.ToBase64CharArray() and Convert.FromBase64CharArray methods
2.45.9.Converts the bit patterns of UInt32 values to Byte arrays with the GetBytes method.
2.45.10.Convert.ToString( non-numeric types, IFormatProvider ).
2.45.11.Create a hexadecimal value out of range of the UInt64 type and Convert it back to a number.