YoseMite Posted August 18, 2005 Share Posted August 18, 2005 Ey,I want get the IP adres, and save this.This is no problem, I use the function _GetIP()Still no problem... But if I look in the log file I see this:BLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML><HEAD><TITLE>Your IP Is 12.34.567.890But I want only see:12.34.567.890Thanks,YoseMite Link to comment Share on other sites More sharing options...
BigDod Posted August 18, 2005 Share Posted August 18, 2005 If I run #include <Inet.au3> $PublicIP = _GetIP() MsgBox(0, "IP Address", $PublicIP) I get just a message box with IP address as expected. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
seandisanti Posted August 18, 2005 Share Posted August 18, 2005 Ey,I want get the IP adres, and save this.This is no problem, I use the function _GetIP()Still no problem... But if I look in the log file I see this:But I want only see:12.34.567.890Thanks,YoseMite<{POST_SNAPBACK}>that information is not being returned by the GetIP() call, it has to be something else in your code, or in the editor that you're using to open the log file... Link to comment Share on other sites More sharing options...
the_lord_mephy Posted August 18, 2005 Share Posted August 18, 2005 Go to Include\Inet.au3 and make sure your _GetIP Function is Func _GetIP() Local $ip If InetGet("http://www.whatismyip.com", @TempDir & "\~ip.tmp") Then $ip = FileRead(@TempDir & "\~ip.tmp", FileGetSize(@TempDir & "\~ip.tmp")) FileDelete(@TempDir & "\~ip.tmp") $ip = StringTrimLeft($ip, StringInStr($ip, "<TITLE>Your ip is ") + 17) $ip = StringLeft($ip, StringInStr($ip, " WhatIsMyIP.com</TITLE>") - 1) Return $ip Else SetError(1) Return -1 EndIf EndFunc My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote] Link to comment Share on other sites More sharing options...
YoseMite Posted August 18, 2005 Author Share Posted August 18, 2005 Hmm... But Can I not only delete the tekst: BLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <TITLE>Your IP Is And save the IP? Link to comment Share on other sites More sharing options...
/dev/null Posted August 18, 2005 Share Posted August 18, 2005 Hmm...But Can I not only delete the tekst:BLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><TITLE>Your IP Is And save the IP?<{POST_SNAPBACK}>can you please tell us in which log file (path and name) you found that text?CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
seandisanti Posted August 18, 2005 Share Posted August 18, 2005 Hmm...But Can I not only delete the tekst:BLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><TITLE>Your IP Is And save the IP?<{POST_SNAPBACK}>technically you COULD.... but it seems the best way to do that is to stop it from being printed in the first place.... Link to comment Share on other sites More sharing options...
YoseMite Posted August 18, 2005 Author Share Posted August 18, 2005 Script: $file = FileOpen("listt.txt", 1) $PublicIP = _GetIP() FileWriteLine($file, ""& $PublicIP) FileClose($file) Link to comment Share on other sites More sharing options...
BigDod Posted August 18, 2005 Share Posted August 18, 2005 When I run that with the addition of #include <Inet.au3> I get the IP address in the file as expected Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Valuater Posted August 18, 2005 Share Posted August 18, 2005 Script:$file = FileOpen("listt.txt", 1)$PublicIP = _GetIP()FileWriteLine($file, ""& $PublicIP)FileClose($file)<{POST_SNAPBACK}>This worked for me too!....You must be reading the wrong file...soTry this$file = FileOpen("listt.txt", 1) $PublicIP = _GetIP() FileWriteLine($file, ""& $PublicIP) FileClose($file) $file = FileOpen("listt.txt", 0) $line = FileReadLine($file) MsgBox(0,"test", $line)you will see too8) Link to comment Share on other sites More sharing options...
solmention Posted August 18, 2005 Share Posted August 18, 2005 technically you COULD.... but it seems the best way to do that is to stop it from being printed in the first place....<{POST_SNAPBACK}>I got this problem too when i first ran the program, I don't know could be the website. since if you go to the website that is being called whatismyip.com your'll see it toggles with "your ip is" and " your ip - " where as in the function getip it's looking for " your ip is" I modified to a more consistent site and made the function a little more dynamic to where you can choose any website that displays the ip including the braces expandcollapse popupFunc _GetIP_Dy($web,$strL,$strR) Local $ip TrayTip("Data Find", "Gathering Information", 2, 1) ;#comments-start Sleep(2000) If InetGet($web, @TempDir & "\~ip.tmp") Then TraySetToolTip ( "first") TrayTip("Operation Completed ", "Sucess", 5, 1) $ip = FileRead(@TempDir & "\~ip.tmp", FileGetSize(@TempDir & "\~ip.tmp")) FileDelete(@TempDir & "\~ip.tmp") $ip = StringTrimLeft($ip, StringInStr($ip, $strL) + StringLen($strL) - 1) $ip = StringLeft($ip, StringInStr($ip, $strR) - 1) Return $ip Elseif _INetGetSource ( $web ) then TrayTip("Data Find", "First attempt failed" & @CRLF & "Attempting second options", 5, 2) Sleep(2000) $ip = _INetGetSource ( $web ) $ip = StringTrimLeft($ip, StringInStr($ip, $strL) + StringLen($strL) - 1) $ip = StringLeft($ip, StringInStr($ip, $strR) - 1) TrayTip("Data Find", "Sucess", 5, 1) Return $ip Else SetError(1) Return -1 EndIf ;#comments-end EndFunc;Function End >> _GetIP_Dy() $strL = "<b>" $strR = "</b>" $web = "http://myipaddress.com/";"http://www.whatismyip.com" $found_ip = _GetDataInner($web,$strL,$strR)this will only give you the ip....I notice aswell with my firewall (zonealarm) the inetget didn't always work..it works fine on another machine, this is why i added inetgetsource which read the code the same why and retrieves the ip. Link to comment Share on other sites More sharing options...
therks Posted August 19, 2005 Share Posted August 19, 2005 (edited) I'm surprised there isn't a site out there that returns just the IP, no surrounding text or html formatting.It's not like it's a hard thing to setup. Look here, I just put this on my site.http://therks.com/ip*Edit: By the way, I've never understood the need for this UDF, isn't this what the @IPAddress macros are for? Edited August 19, 2005 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Valuater Posted August 19, 2005 Share Posted August 19, 2005 I'm surprised there isn't a site out there that returns just the IP, no surrounding text or html formatting.It's not like it's a hard thing to setup. Look here, I just put this on my site.http://therks.com/ip*Edit: By the way, I've never understood the need for this UDF, isn't this what the @IPAddress macros are for?<{POST_SNAPBACK}>Nice Saunders...Thats a much better way then adding more code or includes8) Link to comment Share on other sites More sharing options...
w0uter Posted August 19, 2005 Share Posted August 19, 2005 *Edit: By the way, I've never understood the need for this UDF, isn't this what the @IPAddress macros are for?<{POST_SNAPBACK}>LAN/Router My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Developers Jos Posted August 19, 2005 Developers Share Posted August 19, 2005 (edited) *Edit: By the way, I've never understood the need for this UDF, isn't this what the @IPAddress macros are for?<{POST_SNAPBACK}>@IPAddress1-4 will return the IP adresses of the first four NICs your PC has._GetIP() will return the Public IPAddress on the internet. So when you use a DSL/Cable modem, it probably with use a LAT router and have Ethernet ports for multiple PCs.The LAN switch will use some sort of public ip range on the like 192.168.x.x but this isn't the IP address you Dsl/Cable modem has on the Internet. Edited August 19, 2005 by JdeB 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. 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