Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading Public IP from Windows
Message
 
To
16/08/2006 03:59:02
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 6 SP3
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01033553
Message ID:
01146175
Views:
27
>If I point to http://www.whatismyip.com/
>it tells me my IP.
>I would like to have same result but
>coding.

Tony try this:
Local m.myHTML,m.parsed
parsed = ''
oParser = Createobject('myParser',@m.parsed)
ALINES(myarray,m.Parsed)
MESSAGEBOX("My IP "+myarray[3])

Define Class myParser As Form
  Add Object oWB As OleControl With ;
    OleClass = 'Shell.Explorer'

  Procedure Init
  Lparameters tcParse
  With This.oWB
    .Navigate2('http://www.whatismyip.com/')
    Wait window 'Parsing...' nowait
    Do While .ReadyState # 4 && Wait for ready state
    EndDo
  Endwith
  tcParse = This.oWB.Document.body.innerText
  Wait clear
  Return .f.
Endproc
Enddefine
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform