PDA

View Full Version : How to get the ip address of the laptop in which i run my application



Christina flowers
14th October 2016, 06:31
Hello again My teachers. this time i have an application made by Qt framework. i want to get the Global ip address of the machine in which i run my application.
the same Ip address given by this website https://www.whatismyip.com/ thank you soo much in advance for you time.

jefftee
14th October 2016, 09:09
You can use their API Quick Start (https://www.whatismyip.com/whatismyip-com-api-quick-start-guide/?iref=c1) guide to learn how to programmatically determine your internet ip address. You'll need to use QNetworkAccessManager, QNetworkRequest, and QNetworkReply to make the API request and the QJson* classes to parse the output.

To use their API, you'll need to be a gold level member, which costs $25 per year, but there are other free sites like https://www.ipify.org/ to do the same for free.

Good luck.

anda_skoa
14th October 2016, 11:08
I like http://icanhazip.com/ as it just returns the IP address as plain text, nothing else.

Cheers,
_

jefftee
14th October 2016, 17:05
I like http://icanhazip.com/ as it just returns the IP address as plain text, nothing else.
Even better! :)

Christina flowers
14th October 2016, 21:25
thank you soo much for you reply i apreciate that.

thank you so much. great answer