AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Find out if I have a foreign IP address?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Focused
Guest





PostPosted: Sun Jun 22, 2008 1:13 am    Post subject: Find out if I have a foreign IP address? Reply with quote

My ISP provides me with a dynamic IP address. I live in Sweden and usually get Swedish IP addresses. But sometimes I get russan and german IP addresses. Or at least so it seems. Some applications I have warn me that I can only log in from my registered country.

I'd like to avoid those warnings. I'd like to do that by automatically reconnecting when I get a foreign IP address. Is there any easy way I can check if whether my IP address is Swedish or foreign?

Thanks
Back to top
Focused
Guest





PostPosted: Sun Jun 22, 2008 1:24 am    Post subject: Reply with quote

I kind of solved this. Not the most elegant solution. If anyone knows of a better solution I'd like that. Otherwise this will work:

Code:

   Run, firefox
   Sleep, 10000

   SetTitleMatchMode, 2
   if(WinExist("Mozilla Firefox startsida"))
   {
      WinClose
   }
   else if (WinExist("Mozilla Firefox"))
   {
      WinClose
      Disconnect()
   }
Back to top
Oberon



Joined: 18 Feb 2008
Posts: 458

PostPosted: Sun Jun 22, 2008 10:35 am    Post subject: Reply with quote

You can use free services e.g.

Code:
file = %A_Temp%\geoip
UrlDownloadToFile, *0 http://geoip.co.uk/, %file%
FileRead, html, %file%
FileDelete, %file%
StringMid, html, html, InStr(html, "id=""mapinfo"""), 1000
RegExMatch(html, "<div class=""textright"">(?:[^:]*:){3}\s*([A-Z]{2})", country)

MsgBox, Your IP is in: %country1%
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Aug 20, 2008 9:07 am    Post subject: Reply with quote

You can also try IP Mailer. It constantly monitors your IP, and once you connect with your modem or your IP changes for some other reason, it will detect it automatically.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group