I WPF/C#
desktop application, how to get the country where the user currently is running the application ?
I quess the following just returns the value based on whatever is selected in regional and language options of the Control Panel, therefore making it unusable here.
string countryName = RegionInfo.CurrentRegion.DisplayName;
Found this site for utilizing IP address: http://www.hostip.info/use.html
but this is a corporate application and wondering if used in a corporate VPN therefore possible returning an incorrect country (I want the country where the user is currently sitting physically).
What would be the preferred (most reliable) way to get the country in this setting ?
The way with the regional and language options is imho the right. You also could write something online where u track the public ip adresses and then watch where there are from (but in times with Tor, Proxies, .. it also isnt the best way and u need a connected internet. May we can help u by another way..can u descripe why u want to know the county? greats
You can't reliably do it. Things you can try that can get you closer.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.