在ASP.NET 4.0中的最好的浏览器检测解决方案, [英] The best browser detection solution in ASP.NET 4.0

查看:168
本文介绍了在ASP.NET 4.0中的最好的浏览器检测解决方案,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我GOOGLE了这个话题,我用三种不同的方式来配置浏览器功能碰到:的browscap.ini,的browserCaps元素在web.config中和.browser文件App_Browsers文件。我以为.browser文件是最新的方式,但我似乎还没有找到了最新的文​​件。但我发现从挺新鲜的browscap.ini <一个href=\"http://browsers.garykeith.com/downloads.asp\">http://browsers.garykeith.com/downloads.asp.

I googled this topic and I came across with three different ways to configure browser capabilities: browscap.ini, browserCaps element in web.config and .browser files in App_Browsers. I thought .browser files is the latest way, but I don't seem to find up-to-date files. But I found quite fresh browscap.ini from http://browsers.garykeith.com/downloads.asp.

我的首要任务是从访问者的统计排除常见的爬虫。第二个重点是检测浏览器和操作系统使用正确的版本(例如歌剧11 / Win7的)。

My first priority is to exclude common crawlers from the visitor stats. The second priority is to detect browser and os with correct versions (e.g. Opera 11 / Win7).

有我可以使用任何库?是的browscap.ini仍然是一个有效的方式,也是有可能使用它无需访问系统文件?我在哪里可以找到了最新的.browser文件?

Are there any libraries I could use? Is browscap.ini still a valid way and is it possible to use it without access to system files? Where can I find up-to-date .browser files?

推荐答案

我发现了一个用户代理解析器的http://用户代理-string.info/ ,它似乎是为我的目的已经足够了。

I found a user agent parser from http://user-agent-string.info/ and it seems to be good enough for my purposes.

这篇关于在ASP.NET 4.0中的最好的浏览器检测解决方案,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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