yucatan Posted April 27, 2008 Share Posted April 27, 2008 (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 Edited April 27, 2008 by yucatan Link to comment Share on other sites More sharing options...
monoceres Posted April 27, 2008 Share Posted April 27, 2008 (edited) Wrote this some time ago: #include <INet.au3> Dim $ip $data=_INetGetSource("http://whatsmyip.net/") $data=StringTrimLeft($data,StringInStr($data,"""readonly"">")+10) $data=StringLeft($data,StringInStr($data,"<")-1) $ip=$data Edited April 27, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
herewasplato Posted April 27, 2008 Share Posted April 27, 2008 _GetIP() [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
NELyon Posted April 27, 2008 Share Posted April 27, 2008 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 More sharing options...
monoceres Posted April 27, 2008 Share Posted April 27, 2008 _GetIP()How long have that been there? Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
herewasplato Posted April 27, 2008 Share Posted April 27, 2008 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 More sharing options...
flip209 Posted April 27, 2008 Share Posted April 27, 2008 _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 More sharing options...
herewasplato Posted April 28, 2008 Share Posted April 28, 2008 (edited) _GetIP() does not get your external Ip address though It will only return your private IP example 192.168.1.1Are 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 April 28, 2008 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted April 28, 2008 Share Posted April 28, 2008 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] Link to comment Share on other sites More sharing options...
Legacy99 Posted April 28, 2008 Share Posted April 28, 2008 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 More sharing options...
flip209 Posted April 28, 2008 Share Posted April 28, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now