Jump to content

IP addres


Recommended Posts

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
Link to comment
Share on other sites

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())
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

_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

Link to comment
Share on other sites

_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]

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...