bshellenbaum Posted May 18, 2005 Posted May 18, 2005 Here's a script scrap that returns the router wan ip by going to a website that returns it in a one line web page. My apologies if this has been done before. _________________________________________ #include <File.au3> #include <GUIConstants.au3> Dim $temp, $wanip , $result1, $file inetget ("http://checkip.dyndns.org", "c:\waniptemp.txt" , 1,0) $file= FileOpen("c:\waniptemp.txt",0) $temp = FileRead( $file,120 ) fileclose($file) filedelete ("C:\waniptemp.txt") $result = stringinstr( $temp, "Address:") $result1 =StringInStr($temp, "</body>") ; above lines find text before and after the IP address in the resultant web page & file $wanip = stringmid( $temp, $result+8, $result1-($result+8)) msgbox(0,"Wan IP Address", $wanip) ___________________________________________
busysignal Posted May 19, 2005 Posted May 19, 2005 Here's a script scrap that returns the router wan ip by going to a website that returns it in a one line web page. My apologies if this has been done before._________________________________________#include <File.au3>#include <GUIConstants.au3>Dim $temp, $wanip , $result1, $fileinetget ("http://checkip.dyndns.org", "c:\waniptemp.txt" , 1,0)$file= FileOpen("c:\waniptemp.txt",0)$temp = FileRead( $file,120 )fileclose($file)filedelete ("C:\waniptemp.txt")$result = stringinstr( $temp, "Address:")$result1 =StringInStr($temp, "</body>") ; above lines find text before and after the IP address in the resultant web page & file$wanip = stringmid( $temp, $result+8, $result1-($result+8))msgbox(0,"Wan IP Address", $wanip) ___________________________________________<{POST_SNAPBACK}>It has been done before but it is always good to see different code to achieve the same result. It give people ideas on how to do things differently.. Cheers ..
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