Get user location by IP address

前端 未结 14 1239
深忆病人
深忆病人 2020-11-28 02:23

I have an ASP.NET website written in C#.

On this site I need to automatically show a start page based on the user\'s location.

Can I get name of user\'s city

14条回答
  •  抹茶落季
    2020-11-28 02:35

    You need an IP-address-based reverse geocoding API... like the one from ipdata.co. I'm sure there are plenty of options available.

    You may want to allow the user to override this, however. For example, they could be on a corporate VPN which makes the IP address look like it's in a different country.

提交回复
热议问题