大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Dim a As Byte() = New Byte() {1, 2, 3, 4}
定制网站开发可以根据自己的需求进行定制,成都网站设计、成都做网站构思过程中功能建设理应排到主要部位公司成都网站设计、成都做网站的运用实际效果公司网站制作网站建立与制做的实际意义
Dim b As Byte() = New Byte() {5, 6, 7, 8}
Dim c As Byte() = a.Concat(b).ToArray
'c={1,2,3,4,5,6,7,8}
把结果用字节集变量,再其字节集数据,长整数就行了,多大都能取
在VB.NET中如果需要将一个字符串转换成字节数组,可以使用System.Text命名空间中某个编码对象的GetBytes方法。
Dim strText As String = "This is an original string"
Private Function Conver_Hex(ByVal L As Long) As Array
Dim str_L As String = Hex(L)
If str_L.Length \ 2 0 Then
str_L = "0" str_L
End If
Dim byt(str_L.Length / 2 - 1) As Byte
For i = 0 To str_L.Length / 2 - 1
byt(i) = Convert.ToByte(str_L.Substring(2 * i, 2), 16)
Next
Return byt
End Function
'下面是调用代码
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim L As Double = 123456
Dim byt() As Byte = Conver_Hex(L)
End Sub