Jump to content

Recommended Posts

Posted (edited)

Hi i'm looking for a way to detect my IP adress here a sample of what i meen i need the extrern ip not the intern ip

something like this. that i the internet ip adres have in a $var

post-33750-1209334471_thumb.jpg

Edited by yucatan
Posted

Tons of ways to skin this cat:

Func _RetrieveIP($file = "")
    local $ip, $tempfile = @TempDir & "\ip.txt"
    If $file = "" Then
        InetGet("http://whatismyip.com/automation/n09230945.asp",  $tempfile)
        If @Error Then
            return 0
        Else
            $ip = FileRead($tempfile)
            return $ip
        EndIf
    ElseIf $file <> "" Then
        InetGet("http://whatismyip.com/automation/n09230945.asp",  $tempfile)
    If @error Then
            return 0
        Else
            FileMove($tempfile, $file)
        EndIf
    EndIf
    FileDelete($tempfile)
EndFuncoÝ÷ Ù8^ëjëh×6MsgBox(0, "Test", _RetrieveIP())
Posted

How long have that been there?

According to the file named "ChangeLog.txt", it was added on...

1.03 (6 February 2005)

...with several changes along the way to deal with the website changing its layout

:-)

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

Posted

_GetIP() does not get your external Ip address though It will only return your private IP example 192.168.1.1

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Posted (edited)

_GetIP() does not get your external Ip address though It will only return your private IP example 192.168.1.1

Are you sure about that?

It works for me.

The help file states:

Get public IP address of a network/computer.

Try this code from the help file:

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

Maybe you are think about the @IPAddress1 macro which returns:

IP address of first network adapter. Tends to return 127.0.0.1 on some computers.

Edited by herewasplato

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

Posted

Tons of ways to skin this cat:

...and just what do you do what a cat once it has been skinned. NVM, I don't think that I really want to know. :-)

...the other white meat...

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

Posted

Story checks out

GetIP() gets the Public IP for me.

Are you sure about that?

It works for me.

The help file states:

Get public IP address of a network/computer.

Try this code from the help file:

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

Thats weird last time I used it it gave me the local static IP address.... Which was not my public address.... Good to know it is not now..

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

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...