How to get a current user location in asp.net

我的梦境 提交于 2019-12-11 18:07:04

问题


There is a website that support shops information like food,drink,golf,spa. This websites provide information on Thailand, Hongkong, Singapore and Cambodia. If a user from Thailand connect this website. The default menu will be set to Thailand. If a user from Hongkong use this website. We will set default menu to Hongkong. If a user from others country that is not in the list. the default will be set to Thailand.

What is the best way to do this.


回答1:


I use Google Loader https://developers.google.com/loader/.

Similiar question here on SO. The accepted answer even has an example page.




回答2:


You can get the location of incoming request by the following service. Which will give you country and city.

http://api.hostip.info/get_html.php?ip=207.46.197.32

There is a open source which will do the same for you, please have a look here

If you need more then visit here



来源:https://stackoverflow.com/questions/10407921/how-to-get-a-current-user-location-in-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!