我的服务器上有这段代码,它创建了更新消息
StrMsg = "1~Server~"
For x = 0 To Combo1.ListCount - 1
If x = Combo1.ListCount - 1 Then
StrMsg = StrMsg & Combo1.List(x)
Else
StrMsg = StrMsg & Combo1.List(x) & "~"
End If
Next x
' send it to every connected clients
For x = 0 To clientCounter - 1
sckClients(x).SendData StrMsg
Next x
客户端会收到它然后把它放在 ComboBox1
Private Sub sckClient_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim strMsg As String, tmp() As String, i As Integer
sckClient.GetData strMsg$, vbString
tmp$() = Split(strMsg$, "~")
For i% = 1 To CInt(tmp$(0)) - 1
Combo1.AddItem tmp$(i%)
Next i%
sckClient.GetData strData, vbString
End Sub
但是为什么我总是得到一个运行时错误 13 类型不匹配?
这里似乎有什么问题?-_-