关于VB局域网聊天

PrivateSubcmdConnect_Click()OnErrorGoToErrHandlerWithWinsockl.RemoteHost=Trim(Text1).... Private Sub cmdConnect_Click()
On Error GoTo ErrHandler
With Winsockl
.RemoteHost = Trim(Text1)
.RemotePort = Trim(Text2)
.LocalPort = Trim(Text3)
Label5.Caption = Label5.Caption + .localIP
.Bind.LocalPort
End With
Tex5.SetFocus
Exit Sub
ErrHandler:
MsgBox "Winsock failed to establish connection With remite serve", vbCritical
End Sub

Private Sub CmsExit_Click()
Unliad Me
End Sub
Private Sub CmsSend_Click()
Static Last_Line_Fees As Long
Dim New_Line As String
New_Line = Mid(Text5, Last_Line_Feed + 1)
Last_Line_Feed = Text5.SelStart
Winsockl.SendData New_Line
End Sub
Private Sub Winsockl_DataArrval(ByVal bytestotal As Long)
Dim New_Text As String
Winsockl.GetData New_Text
Text4.CalText = New_Text
Label4.Caption = Label4.Caption + Winsockl.RemoteHostIP
End Sub
这段代码那里错了啊
展开
 我来答
杨洪扣
2007-05-10
知道答主
回答量:29
采纳率:0%
帮助的人:0
展开全部
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
On Error Resume Next
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.Accept requestID
End Sub
叶子不改
2007-05-08 · TA获得超过174个赞
知道答主
回答量:78
采纳率:0%
帮助的人:0
展开全部
你的Winsock控件没有启动Listen方法!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式