📄 form1.frm
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5430
ClientLeft = 165
ClientTop = 735
ClientWidth = 4785
LinkTopic = "Form1"
ScaleHeight = 5430
ScaleWidth = 4785
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame4
Height = 735
Left = 120
TabIndex = 6
Top = 4440
Width = 4575
Begin MSWinsockLib.Winsock Winsock
Left = 4080
Top = 240
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 8
Top = 240
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "发送"
Height = 375
Left = 600
TabIndex = 7
Top = 240
Width = 1335
End
End
Begin VB.Frame Frame3
Caption = "发送信息"
Height = 1695
Left = 0
TabIndex = 4
Top = 2640
Width = 4695
Begin VB.TextBox Text3
Height = 1335
Left = 120
MultiLine = -1 'True
TabIndex = 5
Top = 240
Width = 4455
End
End
Begin VB.Frame Frame2
Caption = "接收信息"
Height = 1815
Left = 0
TabIndex = 2
Top = 720
Width = 4695
Begin VB.TextBox Text2
Height = 1455
Left = 120
MultiLine = -1 'True
TabIndex = 3
Top = 240
Width = 4455
End
End
Begin VB.Frame Frame1
Height = 615
Left = 0
TabIndex = 0
Top = 0
Width = 4695
Begin VB.CommandButton Command3
Caption = "连接"
Height = 255
Left = 3120
TabIndex = 9
Top = 240
Width = 1335
End
Begin VB.Label Label2
BorderStyle = 1 'Fixed Single
Height = 255
Left = 1080
TabIndex = 10
Top = 240
Width = 1815
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "服务器ip:"
Height = 180
Left = 120
TabIndex = 1
Top = 240
Width = 900
End
End
Begin VB.Menu file
Caption = "文件"
Begin VB.Menu exit
Caption = "退出"
Shortcut = ^Q
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Command3.Enabled = True Then
MsgBox "没有连接!"
Else
Winsock.SendData Text3.Text
End If
End Sub
Private Sub Command2_Click()
Text3.Text = ""
End Sub
Private Sub Command3_Click()
Winsock.Connect
Command3.Enabled = False
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub Form_Load()
Winsock.RemoteHost = "127.0.0.1"
Winsock.RemotePort = 4949
Label2.Caption = Winsock.RemoteHost
End Sub
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Dim js As String
Winsock.GetData js, vbString
Text2.Text = js
End Sub
Private Sub Form_Unload(Cancel As Integer)
Winsock.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -