回复 9楼 wds1
谢谢版主:终于搞通了,十分感谢!Dim udhi(31) As Byte '定义头数组
Dim txt() As Byte '定义正文数组
Dim Send_data() As Byte
'下面部分也可以定义结构体
Dim No1 As Long
Dim No2 As Long
Dim ip As String
Dim len1 As Long
Dim Txt1 As String
'赋值
No1 = 1
No2 = 2
Txt1 = "000000"
len1 = LenB(Txt1)
Txt2 = "192.168.1.2测试测试........."
'数据转为数组
CopyMemory udhi(0), No1, 4
CopyMemory udhi(4), No2, 4
CopyMemory udhi(31), len1, 4
txt = StrConv(Txt2, vbFromUnicode)
ReDim Send_data(UBound(udhi) + UBound(txt) + 1)
For i = 0 To 31: Send_data(i) = udhi(i): Next
For i = 0 To UBound(txt): Send_data(32 + i) = txt(i): Next i
Winsock1.SendData Send_data