To zyhjswx(无聊豹)我要转的是结构体,如果cvar不支持的话,有什么办法可以让结构体变成byte类型?
To gulingfeng(凌峰)用winsock发出去。
把private sub 改成 public sub
不要直接用Type 否则绝对无法实现的 Dim TempBytes() as Byte Dim SendBytes() as Byte Dim TempInt as IntegerTempBytes=StrConv(字符串, vbFromUniCode) TempInt=UBound(TempBytes)+1 ReDim SendBytes(0 to TempInt+1) CopyMemory SendBytes(0), TempInt, 2 CopyMemory SendBytes(2), TempBytes(0), TempInt
否则绝对无法实现的
Dim TempBytes() as Byte
Dim SendBytes() as Byte
Dim TempInt as IntegerTempBytes=StrConv(字符串, vbFromUniCode)
TempInt=UBound(TempBytes)+1
ReDim SendBytes(0 to TempInt+1)
CopyMemory SendBytes(0), TempInt, 2
CopyMemory SendBytes(2), TempBytes(0), TempInt