获取 asp.net 中可用的语言
我正在尝试在访客电脑上安装可用的语言。 问题是我不想从互联网浏览器获取语言。
请问有什么建议吗?
i am trying to get the available languages installed in visitors pc's.
The problem is that i don't want to get the languages from the internet browser.
Any suggestions please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
唯一(标准)的方法是查看 HTTP 标头的“Accept-Language”。请参阅标准。如果您可以在未经许可的情况下访问更多信息,这将是一个安全漏洞。
您可以运行一些 Active X 组件来监视用户的计算机,但您必须先获得他们的许可,但我怀疑这只会导致人们不想使用您的网站。而且它只能在 Windows 上运行。我不建议这样做。
当然,您随时可以要求用户通过某些设置页面告诉您。如果更改此设置可以帮助他们使用您的网站,他们可能不会介意这样做。
The only (standard) way is to look in the HTTP header's 'Accept-Language'. See the standard. It would be a security hole if you could get access to more information than that without asking permission.
You could run some Active X component to spy on the users' computers, but you'd have to get them to give you permission first, but I suspect that will just cause people to not want to use your website. Also it would only work on Windows. I wouldn't recommend doing this.
Of course, you can always ask your users to tell you via some settings page. If changing this setting would help them to use your site, they would probably not mind doing that.