⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmpeerb.frm

📁 vb编程+从基础到实践光盘代码
💻 FRM
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form frmPeerB 
   Caption         =   "PeerB"
   ClientHeight    =   1485
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3945
   LinkTopic       =   "Form1"
   ScaleHeight     =   1485
   ScaleWidth      =   3945
   StartUpPosition =   3  '窗口缺省
   Begin MSWinsockLib.Winsock udpPeerB 
      Left            =   120
      Top             =   480
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
      Protocol        =   1
   End
   Begin VB.TextBox txtOutput 
      Height          =   375
      Left            =   1080
      TabIndex        =   1
      Top             =   840
      Width           =   2655
   End
   Begin VB.TextBox txtSend 
      Height          =   375
      Left            =   1080
      TabIndex        =   0
      Top             =   120
      Width           =   2655
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "接受信息"
      Height          =   180
      Left            =   240
      TabIndex        =   3
      Top             =   960
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "发出信息"
      Height          =   180
      Left            =   240
      TabIndex        =   2
      Top             =   240
      Width           =   720
   End
End
Attribute VB_Name = "frmPeerB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
    '控件的名字为 udpPeerB。
    With udpPeerB
        '重点:必须将 RemoteHost 的值改为
        '计算机的名字。
        .RemoteHost = "localhost"
        .RemotePort = 1002    '要连接的端口。
        .Bind 1001                '绑定到本地的端口上。
    End With
End Sub

Private Sub txtSend_Change()
    '在键入文本后立即发送文本。
    udpPeerB.SendData txtSend.Text
End Sub

Private Sub udpPeerB_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
    udpPeerB.GetData strData
    txtOutput.Text = strData
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -