Module BinaryConverter Sub main() Dim b() As Byte = {1, 2, 3} Dim result As ULong = Unsigned(b) Dim result1 As ULong = Raw(b) Dim result2 As String = RawString(result, 3) End Sub Function Unsigned(s As Byte()) As ULong Dim i As ULong = 0 For Each b As Byte In s i = (i * 256) + b Next Return i End Function Function Raw(s As Byte()) As ULong Dim i As ULong = 0 For Each b As Byte In s i = (i << 8) Or b ' Left shift and add the byte Next Return i End Function Function RawString(i As ULong, size As Integer) As String Dim s As String = String.Empty For j As Integer = 0 To size - 1 s = ChrW(i And &HFF) & s ' Add the lowest byte i >>= 8 ' Right shift Next Return s End Function End Module