Sign in to follow this  
Followers 0
yucatan

IP addres

11 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



_GetIP()


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

Share this post


Link to post
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())

Share this post


Link to post
Share on other sites

_GetIP()

How long have that been there?

Broken link? PM me and I'll send you the file!

Share this post


Link to post
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]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#8 ·  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]

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
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)

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0