none
how to detect the location of a web application user RRS feed

  • Question

  • hi, experts, 

    I am going to do an web application. just take online store for example.

    usually on online store. there would be location  detection . 

    let's say by the countries,. it redirects to different page.

    how to do it ?

    by ip address ? can it detect down to city or a country?

    or further, by 'zones' of a city?

    how to do ?

    thank you very much!

    delaynomore


    delaynomore.

    Tuesday, June 6, 2017 3:33 AM

Answers

  • hi, experts, 

    I am going to do an web application. just take online store for example.

    usually on online store. there would be location  detection . 

    let's say by the countries,. it redirects to different page.

    how to do it ?

    by ip address ? can it detect down to city or a country?

    or further, by 'zones' of a city?

    how to do ?

    thank you very much!

    delaynomore


    delaynomore.

    Good day,

    You can develop your own "Geolocation of an IP Address" system, which is very simple if you get all the IP information and keep it updated. The information can taken from the Internet Assigned Numbers Authority (IANA), who in-charge of dividing the IPs to ISP or local Internet organizations.

    Once you have all the data in your database, you simply need to check what is the IP of the request that your server got. Any request (for the sake of the discussion let's talk about request from browsers) includes header with all the information including the source IP.

    This link should help in getting the IP address:
    https://forums.asp.net/t/1991213.aspx?Get+User+Location+by+IP+Address+Using+asp+net+C+

    * Another option is to use API from external service. For example Google has this service as well as several thousands other places. A simple solution you can get from this website without the need to register but I am not sure how reliable it is for constant use http://freegeoip.net/

    If you have anymore question or you need clarification, then best option as Dave said, is to ask your question in the asp.net forums.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]



    Sunday, June 11, 2017 3:13 AM
    Moderator
  • Might also ask over here.

    https://forums.asp.net/

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, June 6, 2017 12:33 PM
    Moderator

All replies

  • Do you need HTML code for that?

    Tuesday, June 6, 2017 5:24 AM
  • Likely a web application would be HTML.  Have you looked at Geolocation as an option?

    https://www.w3schools.com/html/html5_geolocation.asp

    Tuesday, June 6, 2017 6:14 AM
  • Might also ask over here.

    https://forums.asp.net/

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, June 6, 2017 12:33 PM
    Moderator
  • hi, experts, 

    I am going to do an web application. just take online store for example.

    usually on online store. there would be location  detection . 

    let's say by the countries,. it redirects to different page.

    how to do it ?

    by ip address ? can it detect down to city or a country?

    or further, by 'zones' of a city?

    how to do ?

    thank you very much!

    delaynomore


    delaynomore.

    Good day,

    You can develop your own "Geolocation of an IP Address" system, which is very simple if you get all the IP information and keep it updated. The information can taken from the Internet Assigned Numbers Authority (IANA), who in-charge of dividing the IPs to ISP or local Internet organizations.

    Once you have all the data in your database, you simply need to check what is the IP of the request that your server got. Any request (for the sake of the discussion let's talk about request from browsers) includes header with all the information including the source IP.

    This link should help in getting the IP address:
    https://forums.asp.net/t/1991213.aspx?Get+User+Location+by+IP+Address+Using+asp+net+C+

    * Another option is to use API from external service. For example Google has this service as well as several thousands other places. A simple solution you can get from this website without the need to register but I am not sure how reliable it is for constant use http://freegeoip.net/

    If you have anymore question or you need clarification, then best option as Dave said, is to ask your question in the asp.net forums.


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]



    Sunday, June 11, 2017 3:13 AM
    Moderator