Sub Main()
Dim num1 As Integer = 65536
Dim shi() As Byte = System.BitConverter.GetBytes(num1)
Dim list As New List(Of Byte) '存放要发送数据的列表
For i = 0 To shi.Count - 1
list.Add(shi(i))
Next
Dim newbuffer() As Byte = list.ToArray() '将泛型集合转换为数组
Dim shi0 As Integer = System.BitConverter.ToInt32(newbuffer, 0)
Console.WriteLine(shi0.ToString)
Console.ReadLine()
End Sub
Dim num1 As Integer = 65536
Dim shi() As Byte = System.BitConverter.GetBytes(num1)
Dim list As New List(Of Byte) '存放要发送数据的列表
For i = 0 To shi.Count - 1
list.Add(shi(i))
Next
Dim newbuffer() As Byte = list.ToArray() '将泛型集合转换为数组
Dim shi0 As Integer = System.BitConverter.ToInt32(newbuffer, 0)
Console.WriteLine(shi0.ToString)
Console.ReadLine()
End Sub