Jump to content

Recommended Posts

  • Developers
Posted (edited)

Your Thread title is misleading :)

To answer your question: My guess is that you are connected to the Internet via a NAT router meaning that your PC's NIC has a different IP address than your Public Internet Ip address since that address is assigned to your router.

;)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted (edited)

real quick and dirty:

#include <INet.au3>
#include <String.au3>
MsgBox(0, "from IPAddress1", @IPAddress1 )
$source = _INetGetSource( "http://whatsmyip.org" )
$IP = _StringBetween( $source, "Your IP is ", "</title>" )
MsgBox( 0, "From whatsmyip.org", $IP[0] )

I am sure there are about a hundred ways to do this better, but this is what I threw together real quick.

This will get the ip address returned from the site you mentioned.

EDIT: There will be ways to do this without connecting to an external site, maybe by connecting to the router, or telnet to the router... lol, or just wait for somebody that knows more than me to post :) where are you now Geo? Penguins? (the one time I actually want to see you correct me after I post LMAO)

Edited by danwilli
Posted (edited)

Thanks I'll try that.

I just noticed. You joined this forum 1 day before me and you already got 1022 post count - wow lol. :)

Edit:

It worked!

Edited by sensalim
Posted (edited)

_GetIP() is included in v3.2.10.0

#include <Inet.au3>
$PublicIP = _GetIP()
MsgBox(0, "IP Address", "Your IP Address is: " & $PublicIP)

Edit: It pretty much does what danwilli wrote but it uses two sites in case one

is down.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...