在asp.net MVC的有关用户的浏览器我如何获得信息的控制器? [英] in a controller in asp.net-mvc how can i get information about the users browser?

查看:824
本文介绍了在asp.net MVC的有关用户的浏览器我如何获得信息的控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的asp.net MVC的网站记录错误,我想看看是否有反正来检测用户的浏览器信息(名称,版本等),因为它看起来像人们越来越问题,但它的,因为他们是使用很老的浏览器。这些信息将帮助我避免调试的时间,如果我知道他们使用的是不支持的浏览器。

i am logging errors on my asp.net-mvc site and i wanted to see if there is anyway to detect the users browser info (name, version, etc) as it seems like people are getting issue but its because they are using very old browser. This info would help me avoid debugging time if i know they are using a "Not supported" browser.

推荐答案

您可以尝试<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.htt$p$pquestbase.browser.aspx\">Request.Browser属性。它将包含你可能需要对客户端浏览器(假设它在发送的UserAgent头妥善当然)pretty太多的一切。

You may try the Request.Browser property. It will contain pretty much everything you might need about the client browser (assuming it is sending the UserAgent header properly of course).

这篇关于在asp.net MVC的有关用户的浏览器我如何获得信息的控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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