c++ - win32 api to geolocate laptop based on wifi and IP address -
how can fetch ip address of laptop , geo-locate or find latitude , longitude ? , how can geo-locate laptop using wifi connection? need implement in c++/com without using third party library. please suggest way.
how can fetch ip address of laptop
use getadaptersinfo()
or getadaptersaddresses()
.
just keep in mind laptop may connected multiple networks @ same time, , have multiple ip addresses assigned. , if laptop connected network/wifi router, going have ip address lan side of router, not internet side. have know router's public internet ip beforehand, or use upnp/snmp query router, or use external service http://iplookup.flashfxp.com.
and geo-locate or find latitude , longitude ?
windows 7 , later has sensor api interacting various sensors, including gps devices. assuming laptop not have gps installed, have know internet ip , can perform location lookup using external service, such freegeoip s.t. suggested.
Comments
Post a Comment