form1.frm
来自「一个在vb环境实现系统ping功能操作的简单范例有需要的朋友可以」· FRM 代码 · 共 56 行
FRM
56 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 285
Left = 1680
TabIndex = 1
Text = "169.254.234.151"
Top = 2130
Width = 1515
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 465
Left = 870
TabIndex = 0
Top = 2520
Width = 3135
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
'ping an ip address, passing the
'address and the ECHO structure
Call Ping(Text1.Text, ECHO)
'display the results from the ECHO structure
Form1.Print GetStatusCode(ECHO.status)
Form1.Print ECHO.Address
Form1.Print ECHO.RoundTripTime & " ms"
Form1.Print ECHO.DataSize & " bytes"
If Left$(ECHO.Data, 1) <> Chr$(0) Then
pos = InStr(ECHO.Data, Chr$(0))
Form1.Print Left$(ECHO.Data, pos - 1)
End If
Form1.Print ECHO.DataPointer
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?