Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim b1() As Byte = {&H1} Dim b2() As Byte = {&H23, &H45} Dim b3() As Byte = {&H67, &H89, &HAB} TextBox1.Text = BitConverter.ToString(b1) TextBox2.Text = BitConverter.ToString(b2) TextBox3.Text = BitConverter.ToString(b3) End Sub
Dim bin As Byte() = {&HFF, &H3} Dim a As Short = BitConverter.ToInt16(bin, 0) '符号付き 2 バイト整数に変換 Dim b As String = Convert.ToString(a, 10) '10進数表記の "1023" に変換