这里有什么不对吗?

[复制链接]
查看11 | 回复1 | 2011-4-4 09:01:11 | 显示全部楼层 |阅读模式
Private Sub Form_Load()
server.LocalPort = 3000
client.RemoteHost = \"192.168.1.1\"
client.RemotePort = 3000
server.Bind
server.Listen
client.Connect
End Sub
Private Sub client_connect()
MsgBox \"连接成功\"
End Sub
Private Sub form_click()
client_connect
Print server.State
Print client.State
client.SendData \"收到了吗?\"
End Sub

Private Sub server_ConnectionRequest(ByVal requestID As Long)
server.Close
server.Accept requestID
MsgBox \"已经连接\"
End Sub

Private Sub server_DataArrival(ByVal bytesTotal As Long)
Dim contents As String
server.GetData contents, vbString
Print contents
End Sub
回复

使用道具 举报

千问 | 2011-4-4 09:01:11 | 显示全部楼层
<pre class=\"replyask-text\" id=\"content-2380906\">运行的时候,state属性为2,6,表示正在监听和正在连接啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行