Dim a As Byte() = New Byte() {1, 2, 3, 4}
定制網(wǎng)站開發(fā)可以根據(jù)自己的需求進(jìn)行定制,成都網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站構(gòu)思過程中功能建設(shè)理應(yīng)排到主要部位公司成都網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站的運(yùn)用實(shí)際效果公司網(wǎng)站制作網(wǎng)站建立與制做的實(shí)際意義
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}
把結(jié)果用字節(jié)集變量,再其字節(jié)集數(shù)據(jù),長整數(shù)就行了,多大都能取
在VB.NET中如果需要將一個(gè)字符串轉(zhuǎn)換成字節(jié)數(shù)組,可以使用System.Text命名空間中某個(gè)編碼對象的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
'下面是調(diào)用代碼
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