关于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
这段代码那里错了啊 展开
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
这段代码那里错了啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询