就是这句:Text2.Text = Trim(Mid(s, p1 + Len(">>"), p2 - p1 - Len(">>"))) Mid的第三个参数它是怎么计算的?
先用P1-len(">>") 得到结果在用p2-p1? ---还是先用P2-P1得到结果后在用结果减去len(">>")呢?
我想知道的是mid第三个参数计算的顺序....谢谢..有的绕口了...呵呵!下面是全部代码:
Private Sub Command1_Click()
Inet1.Execute "http://www.ip138.com/ips.asp?ip=" + Text1.Text + "&action=2"
End Sub!
Private Sub Form_Load()
Text1.Text = "houseofwah.3322.org"
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error Resume Next
If State = 12 Then
Do
a = Inet1.GetChunk(1024)
If a = "" Then Exit Do
s = s & a
Loop
p1 = InStr(1, s, ">>")
p2 = InStr(1, s, "</font></h1></td>")
Text2.Text = Trim(Mid(s, p1 + Len(">>"), p2 - p1 - Len(">>")))
End If
End Sub
先用P1-len(">>") 得到结果在用p2-p1? ---还是先用P2-P1得到结果后在用结果减去len(">>")呢?
我想知道的是mid第三个参数计算的顺序....谢谢..有的绕口了...呵呵!下面是全部代码:
Private Sub Command1_Click()
Inet1.Execute "http://www.ip138.com/ips.asp?ip=" + Text1.Text + "&action=2"
End Sub!
Private Sub Form_Load()
Text1.Text = "houseofwah.3322.org"
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error Resume Next
If State = 12 Then
Do
a = Inet1.GetChunk(1024)
If a = "" Then Exit Do
s = s & a
Loop
p1 = InStr(1, s, ">>")
p2 = InStr(1, s, "</font></h1></td>")
Text2.Text = Trim(Mid(s, p1 + Len(">>"), p2 - p1 - Len(">>")))
End If
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货