Private Sub Command1_Click()
Dim a As String, L As Integer
Dim iByte() As Byte
a = Hex(256)
L = Len(a)
If L / 2 - L\2 <> 0 Then a = "0" & a
L = Len(a)
ReDim iByte(L / 2 - 1)
Dim i As Integer
For i = 0 To UBound(iByte)
iByte(i) = "&H" & Mid(a, i + 1, 2)
Next
'然后看怎么发这个字节数组,是先发iByte(1)再iByte(0)呢,还是先iByte(0)再发iByte(1),当然是按接收方的数据格式
End Sub
Private Sub Command1_Click()
Dim a As String, L As Integer
Dim iByte() As Byte
a = Hex(256)
L = Len(a)
If L / 2 - L <> 0 Then a = "0" & a
L = Len(a)
ReDim iByte(L / 2 - 1)
Dim i As Integer
For i = 0 To UBound(iByte)
iByte(i) = "&H" & Mid(a, i + 1, 2)
Next
'然后看怎么发这个字节数组,是先发iByte(1)再iByte(0)呢,还是先iByte(0)再发iByte(1),当然是按接收方的数据格式
End Sub