关于WinSock传送Byte数据问题
我用winsock传送Byte型控制指令,但在发送数据时出错。代码如下:
Private Sub CmdSendData_Click()
Dim ByeApplyLevel(127) As Byte
If Not ((WskTCP.State = 0) Or (WskTCP.State = 9)) Then
WskTCP.SendData ByeApplyLevel '出错
End If
End Sub
其中,winsock采用TCP通信。
请大家帮忙解决,谢谢。 --------------------编程问答-------------------- Private Sub CmdSendData_Click() Dim ByeApplyLevel(127) As Byte
If WskTCP.State = 7 Then
WskTCP.SendData ByeApplyLevel
End If
End Sub --------------------编程问答-------------------- Private Sub CmdSendData_Click()
Dim ByeApplyLevel(127) As Byte
ByeApplyLevel赋值,否则你就发送一堆0
If WskTCP.State = 7 Then
WskTCP.SendData ByeApplyLevel
End If
End Sub --------------------编程问答-------------------- 看看这里的socket例子:
http://download.csdn.net/detail/geoff08zhang/4571358
补充:VB , 网络编程