vb做tcp助手时进制转换的问题
--------------------编程问答--------------------
--------------------编程问答--------------------
Dim iBuf() As Byte
Dim lnx As String
Dim i As Long
On Error Resume Next
' 收当前流
ReDim iBuf(bytesTotal - 1)
tcpclient.GetData iBuf
' log每个收到的字节
i = 0
lnx = "SVR-->BYTE:" + Right("0000000" + Hex(i), 8) + "-"
For i = 0 To bytesTotal - 1
lnx = lnx + " " + Right("0" + Hex(iBuf(i)), 2)
If i Mod 16 = 15 Then
debug.print lnx
lnx = "SVR-->BYTE:" + Right("0000000" + Hex(i + 1), 8) + "-"
End If
Next
i = bytesTotal - 1
If i Mod 16 <> 15 Then
debug.print lnx
End If
补充:VB , 基础类