📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Ping测试"
ClientHeight = 3165
ClientLeft = 60
ClientTop = 345
ClientWidth = 6225
LinkTopic = "Form1"
ScaleHeight = 3165
ScaleWidth = 6225
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出程序"
Height = 375
Left = 2880
TabIndex = 6
Top = 2520
Width = 1050
End
Begin VB.TextBox Text2
Height = 360
Left = 4080
TabIndex = 4
Top = 120
Width = 1995
End
Begin VB.ListBox List1
Height = 1500
Left = 48
TabIndex = 3
Top = 600
Width = 6060
End
Begin VB.TextBox Text1
Height = 360
Left = 960
TabIndex = 1
Top = 120
Width = 1995
End
Begin VB.CommandButton Command1
Caption = "开始测试"
Height = 375
Left = 1560
TabIndex = 0
Top = 2520
Width = 1050
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "测试次数:"
Height = 180
Left = 3120
TabIndex = 5
Top = 240
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "IP地址:"
Height = 180
Left = 120
TabIndex = 2
Top = 240
Width = 720
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()
Dim ECHO As ICMP_ECHO_REPLY
Dim pos As Integer
If Not IsNumeric(Trim(Text2)) Then
Text2 = 1
End If
' 如果“测试次数”为空,则测试一次。
For i = 1 To Text2.Text
Ping Text1.Text, ECHO
List1.AddItem "Reply from " & Text1.Text & ": Time = " & ECHO.RoundTripTime & "ms," & " TTL= " & ECHO.Options.Ttl & ", Size= " & ECHO.DataSize & " bytes."
Next i
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
SocketsInitialize
End Sub
Private Sub Form_Unload(Cancel As Integer)
SocketsCleanup
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -