Function GetIPAddress()Dim Flag, SourceSet GetIPObj = WScript.GetObject("http://ipseeker.cn//")Flag = 0For i=1 To 10 If GetIPObj.readyState = "complete" Then Flag=1 Exit For End If WScript.Sleep 500Next
If Flag = 0 ThenGetIPAddress = "Get IP Address Time Out ..."ElseSource = GetIPObj.documentElement.innerTextSet Rep = New RegExpRep.Pattern="(\d+)\.(\d+)\.(\d+)\.(\d+)"For Each result in Rep.Execute(Source) GetIPAddress = result Exit ForNextEnd IfEnd Function