【VB开源代码栏目提醒】:网学会员--在 VB开源代码编辑为广大网友搜集整理了:frmChatA.frm绩等信息,祝愿广大网友取得需要的信息,参考学习。
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form frmChatA
Caption = "ChatA"
ClientHeight = 2175
ClientLeft = 60
ClientTop = 450
ClientWidth = 4335
LinkTopic = "Form1"
ScaleHeight = 2175
ScaleWidth = 4335
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdSend
Caption = "发送"
Height = 375
Left = 3000
TabIndex = 4
Top = 1680
Width = 855
End
Begin VB.TextBox txtSend
Height = 375
Left = 1200
TabIndex = 1
Top = 360
Width = 2895
End
Begin VB.TextBox txtAccept
Height = 375
Left = 1200
TabIndex = 0
Top = 1080
Width = 2895
End
Begin MSWinsockLib.Winsock udpChatA
Left = 480
Top = 1560
_ExtentX = 741
_ExtentY = 741
_Version = 393216
Protocol = 1
End
Begin VB.Label Label1
Caption = "发送的信息"
Height = 255
Left = 120
TabIndex = 3
Top = 480
Width = 975
End
Begin VB.Label Label2
Caption = "接收的信息"
Height = 255
Left = 120
TabIndex = 2
Top = 1080
Width = 975
End
End
Attribute VB_Name = "frmChatA"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdSend_Click()
'发送信息
udpChatA.SendData txtSend.Text '调用SendData发送数据
End Sub
Private Sub Form_Load()
'控件的名字为 udpPeerA
With udpChatA
'将 RemoteHost 的值,修改为计算机的名字,如果是在两台电脑上测试,则设置实际地址
.RemoteHost = "localhost"
.RemotePort = 1001 '连接的端口号。
.Bind 1002 '绑定到本地的端口。
End With
End Sub
Private Sub udpChatA_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
udpChatA.GetData strData '接受数据,保存在变量strData中
txtAccept.Text = strData '显示在文本框中
End Sub
上一篇:
frmChat.frm
下一篇:
那些令你为之触动的好句子,感慨万分