我有以下代码:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Not TextBox1.Text = "" Then
If TextBox1.Text.Contains("ping") Then
Dim PingSplit = TextBox1.Text.Split(" ")
End If
Select Case TextBox1.Text
Case "ping"
MsgBox(PingSplit(2).ToString)' debug
' If Not Regex.Match(PingSplit(2), "\A(\d{1,2}/(1[0-99]\d)/(2[0-55]\d)).(\d{1,2}/(1[0-99]\d)/(2[0-55]\d)).(\d{1,2}/(1[0-99]\d)/(2[0-55]\d)).(\d{1,2}/(1[0-99]\d)/(2[0-55]\d))\Z").Success Then
MsgBox("Invalid address!")
Else
MsgBox(GetPingMs(PingSplit(2)))
End If
End Select
Else
MsgBox("System: Please insert a command!")
End If
End Sub
但是我无法弄清楚如何获取代码以拆分 textbox1 中的文本并将后半部分传递给 GetPingMs 函数,我知道该函数有效,但我无法弄清楚如何传递数据。任何帮助将不胜感激。