I need to get my external (public) IP address from Delphi.
The same IP that is shown by http://www.whatismyip.com for example.
How can I do that ? Winsock doesn’t allow this.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think you can. Well, you could call some service that tells you what your IP address appears to be, ( ex: http://www.whatismyip.com/ ) and figure it out from the response. But I don’t think anything on your PC will be able to tell you what your IP address looks like, to the outside world.
Untested, but I think you can do this with Indy:
Please review the rules/policy at: http://www.whatismyip.com/faq/automation.asp before using this.