我如何才能找到用户的位置GEO使用ASP.NET? [英] How can I find a user's GEO Location using ASP.NET?

查看:110
本文介绍了我如何才能找到用户的位置GEO使用ASP.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能让我的ASP.NET应用程序中的用户的地理位置信息的持有?我已经注意到了如Firefox和谷歌的Chrome浏览器,我(作为用户),我提示以是否要允许网站访问我的位置。

How can I get hold of a user's GEO location within my ASP.NET application? I've noticed on browsers like Firefox and Google Chrome, I (as the user) am prompted as to whether or not to allow the site to have access to my location.

我怎样才能达到类似的事情呢?

How can I achieve a similar thing to this?

推荐答案

您所看到的提示所示,当网站使用的地理位置API 。这是所有的JavaScript,所以你不需要任何种类的服务器支持使用它。如果你想在服务器端的值,可以使用XMLHtt prequest或一个简单的形式邮寄回来。

The prompt you're seeing is shown when a site uses the Geolocation API. It's all JavaScript, so you don't need any kind of server support to use it. If you want the values on the server side, you can send them back using XMLHttpRequest or a simple form post.

这里方便读取源$ C ​​$ C,以及一个演示

这篇关于我如何才能找到用户的位置GEO使用ASP.NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆