DaBoonDockSaint
Member
Believe it or not have a 3bytes that I want to convert to a unsigned 24 bit integer in VB. Anyone know how to do this in .net?
I don't know what that means. Do you just mean that you've got three Bytes?Believe it or not have a 3bytes
Dim str1 As String = "10101010"
Dim str2 As String = "11110000"
Dim str3 As String = "01010101"
Dim byte1 As Byte = Convert.ToByte(str1, 2)
Dim byte2 As Byte = Convert.ToByte(str2, 2)
Dim byte3 As Byte = Convert.ToByte(str3, 2)
MessageBox.Show(byte1.ToString(), "byte1")
MessageBox.Show(byte2.ToString(), "byte2")
MessageBox.Show(byte3.ToString(), "byte3")
Dim uint1 As UInteger = CUInt(byte1) << 16
Dim uint2 As UInteger = CUInt(byte2) << 8
Dim uint3 As UInteger = CUInt(byte3)
Dim uint4 As UInteger = uint1 Or uint2 Or uint3
MessageBox.Show(uint4.ToString(), "uint4")
Dim str4 As String = Convert.ToString(uint4, 2)
MessageBox.Show(str4, "str4")