This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C50EB9.2074A0A0
Content-Type: text/plain;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

Hi,

how do i programmatically retreive current internet ip ?

regards
Hoe
------=_NextPart_000_0008_01C50EB9.2074A0A0
Content-Type: text/html;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-874">
<META content=3D"MSHTML 6.00.2900.2135" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>how do i programmatically retreive =
current internet=20
ip ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>regards</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Hoe</FONT></DIV></BODY></HTML>

------=_NextPart_000_0008_01C50EB9.2074A0A0--

Re: get dynamic internet ip ? by Eric

Eric
Wed Feb 09 01:47:19 CST 2005

This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C50E83.F6B181A0
Content-Type: text/plain;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

loWinSock =3D CREATEOBJECT("MSWinsock.Winsock")
?loWinSock.LocalIP

"tnhoe" <tnhoe@pc.jaring.my> wrote in message =
news:4209b6f7$1_2@news.tm.net.my...
Hi,

how do i programmatically retreive current internet ip ?

regards
Hoe
------=_NextPart_000_000F_01C50E83.F6B181A0
Content-Type: text/html;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-874">
<META content=3D"MSHTML 6.00.2800.1479" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>loWinSock =3D=20
CREATEOBJECT("MSWinsock.Winsock")<BR>?loWinSock.LocalIP<BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"tnhoe" &lt;<A=20
href=3D"mailto:tnhoe@pc.jaring.my">tnhoe@pc.jaring.my</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:4209b6f7$1_2@news.tm.net.my">news:4209b6f7$1_2@news.tm.net.m=
y</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>how do i programmatically retreive =
current=20
internet ip ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>regards</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>Hoe</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000F_01C50E83.F6B181A0--


Re: get dynamic internet ip ? by tnhoe

tnhoe
Wed Feb 09 04:12:41 CST 2005

This is a multi-part message in MIME format.

------=_NextPart_000_0026_01C50ED2.F1B88550
Content-Type: text/plain;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

Eric den Doop" ,

Got it. Thanks.

Regards
Hoe
------=_NextPart_000_0026_01C50ED2.F1B88550
Content-Type: text/html;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-874">
<META content=3D"MSHTML 6.00.2900.2135" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Eric den Doop" ,</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Got it. Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Hoe</FONT></DIV></BODY></HTML>

------=_NextPart_000_0026_01C50ED2.F1B88550--


Re: get dynamic internet ip ? by tnhoe

tnhoe
Wed Feb 09 08:49:33 CST 2005

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C50EF9.9F657840
Content-Type: text/plain;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

Eric den Doop,

But if i use ADSL network router then it gives the network ip instead of =
internet ip ? how to resolve this ?

Regards
Hoe
------=_NextPart_000_000A_01C50EF9.9F657840
Content-Type: text/html;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-874">
<META content=3D"MSHTML 6.00.2900.2135" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Eric den Doop,</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But if i use ADSL network router then =
it gives the=20
network ip&nbsp;instead of&nbsp;internet ip ? how to resolve this =
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Hoe</FONT></DIV></BODY></HTML>

------=_NextPart_000_000A_01C50EF9.9F657840--


Re: get dynamic internet ip ? by Neil

Neil
Wed Feb 09 16:16:25 CST 2005

This is a multi-part message in MIME format.

------=_NextPart_000_0023_01C50EF4.FE818F80
Content-Type: text/plain;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

I don't think there's a magic answer for this one. Generally your router =
will keep its external IP to itself unless you can directly query it, =
which is unlikely for security reasons. There are two ways around this I =
can think of:

1. If you have access to a (external) web server, you could access a web =
script page via IE automation, get the script to pick up the external IP =
and write it to a page you can access, then read the page contents back =
from VFP again with IE automation.

2. Get a static IP for your router.

Option 1 isn't too difficult with some knowledge of ASP/PHP/Perl, etc. =
I've done this and it works OK. Option 2 works better.

HTH,
Neil
"tnhoe" <tnhoe@pc.jaring.my> wrote in message =
news:420a2314$1_1@news.tm.net.my...
Eric den Doop,

But if i use ADSL network router then it gives the network ip instead =
of internet ip ? how to resolve this ?

Regards
Hoe
------=_NextPart_000_0023_01C50EF4.FE818F80
Content-Type: text/html;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-874">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I don't think there's a magic answer =
for this one.=20
Generally your router will keep its external IP to itself unless you can =

directly query it, which is unlikely for security reasons. There are two =
ways=20
around this I can think of:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1. If you have access to a (external) =
web server,=20
you could access a web script page via IE automation, get the script to =
pick up=20
the external IP and write it to a page you can access, then read the =
page=20
contents back from VFP again with IE automation.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>2. Get a static IP for your =
router.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Option 1 isn't too difficult with some =
knowledge of=20
ASP/PHP/Perl, etc. I've done this and it works OK. Option 2 works=20
better.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>HTH,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Neil</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"tnhoe" &lt;<A=20
href=3D"mailto:tnhoe@pc.jaring.my">tnhoe@pc.jaring.my</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:420a2314$1_1@news.tm.net.my">news:420a2314$1_1@news.tm.net.m=
y</A>...</DIV>
<DIV>Eric den Doop,</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But if i use ADSL network router then =
it gives=20
the network ip&nbsp;instead of&nbsp;internet ip ? how to resolve this=20
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>Hoe</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0023_01C50EF4.FE818F80--


Re: get dynamic internet ip ? by tnhoe

tnhoe
Wed Feb 09 22:14:32 CST 2005

This is a multi-part message in MIME format.

------=_NextPart_000_0048_01C50F6A.13FD8920
Content-Type: text/plain;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

Neil Waterworth,

Thanks for info.=20

There is a dirty way to do this by running the windows ipconfig.exe and =
read the external IP.=20

I dont want to do this but seem I have no other choice.

Regards
Hoe
------=_NextPart_000_0048_01C50F6A.13FD8920
Content-Type: text/html;
charset="windows-874"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-874">
<META content=3D"MSHTML 6.00.2900.2135" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Neil Waterworth,</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for info. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>There is a dirty way to do this =
by&nbsp;running the=20
windows ipconfig.exe and read the external IP. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I dont want to do this but seem I have =
no other=20
choice.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Hoe</FONT></DIV></BODY></HTML>

------=_NextPart_000_0048_01C50F6A.13FD8920--


Re: get dynamic internet ip ? by Bernhard

Bernhard
Thu Feb 10 05:19:00 CST 2005

Hi tnhoe

> There is a dirty way to do this by running the windows ipconfig.exe and read
> the external IP.
I think, you have no chance to get the external IP address of your external ADSL
router since Windows doesn't know about the settings of this remote box.

One dirty trick would be to use the tracert command:
tracert some.web.adress -h 3 -d

But read the help of tracert.

Regards
Bernhard Sander

Re: get dynamic internet ip ? by Neil

Neil
Thu Feb 10 14:16:13 CST 2005

I can't get the external IP from either of these dirty methods on my router,
just the internal. I went through all this about 18 months ago trying to get
a stable TS connection to a dynamic IP (now on a static). Not sure what
you're trying to achieve, but maybe dynamic DNS and a name based approach
would help, e.g. sites like http://www.no-ip.com/.

Neil

"Bernhard Sander" <fuchs@individsoft.de> wrote in message
news:uPeORJ2DFHA.936@TK2MSFTNGP12.phx.gbl...
> Hi tnhoe
>
> > There is a dirty way to do this by running the windows ipconfig.exe and
read
> > the external IP.
> I think, you have no chance to get the external IP address of your
external ADSL
> router since Windows doesn't know about the settings of this remote box.
>
> One dirty trick would be to use the tracert command:
> tracert some.web.adress -h 3 -d
>
> But read the help of tracert.
>
> Regards
> Bernhard Sander



Re: get dynamic internet ip ? by tnhoe

tnhoe
Mon Feb 14 01:59:02 CST 2005

"Neil Waterworth" ,

Remember copy ipconfig.exe from c:\windows> into your application directory,
and run this code :-

Run ipconfig.exe > ip.txt
cI=FILETOSTR('ip.txt')
IF AT('PPP',cI)>0
k1=LEN(cI)
k2=rat(':',cI)
cI=RIGHT(cI,k1-k2)
ELSE
cI=''
ENDIF


It will return dynamic IP address. I use it to create a HTML page for
website redirection.
At first i thought there is other way to do this.

Regards
Hoe