如何在ASP.NET中检测BlackBerry Model [英] How to detect BlackBerry Model in ASP.NET

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

问题描述



有没有一种方法可以在asp.net中检测BlackBerry Model,

我已经在网上进行了搜索,但没有找到解决方法

我尝试使用userAgent信息,但似乎格式从一个版本更改为另一个版本,

例如BlackBerry 8900,

Request.UserAgent = "BlackBerry8900/5.0.0.681 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/-1"



适用于BlackBerry Torche:

Request.UserAgent = "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-GB) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.141 Mobile Safari/534.1+"



在此先感谢您的帮助

解决方案

您可以只使用字符串.其中包含查看代理程序中是否包含"Blackberry"的信息

像..

 字符串 agent = Request.UserAgent;
如果(agent.ToLower().包含(" ))
{
    // 任何
} 




这应该告诉您客户端正在使用黑莓设备,但是没有什么比这更具体的了.那是你想要的吗?

评论后

可能会研究使用WURFL设备数据库的51degrees移动设备检测项目

http://51degrees.codeplex.com/releases/view/50532 [ http://51degrees.codeplex.com/documentation [ http://supportforums. blackberry.com/t5/Web-Development/How-to-detect-the-BlackBerry-Browser/ta-p/559862?IID=DEVSF30 [



for BlackBerry Torche :

Request.UserAgent = "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-GB) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.141 Mobile Safari/534.1+"



Thank''s in advance for your Help

You can just use string.Contains to see if the agent has ''Blackberry'' within it

Something like..

string agent = Request.UserAgent;
if (agent.ToLower().Contains("blackberry"))
{
    // whatever
}




This should tell you that the client is using a blackberry device, but nothing more specific than that. Is that what you wanted?

Edit after Comment:

Possibly look into the 51degrees mobile device detection project which uses the WURFL device database

http://51degrees.codeplex.com/releases/view/50532[^]

http://51degrees.codeplex.com/documentation[^]

This should allow you to determine device models without having to add lots of string parsing


This is really an issue of the browser running on the BlackBerry. You would need to know what browsers are available for BlackBerrys and research there.

May we all know why you need the exact model description?


This might help you.

http://supportforums.blackberry.com/t5/Web-Development/How-to-detect-the-BlackBerry-Browser/ta-p/559862?IID=DEVSF30[^]


这篇关于如何在ASP.NET中检测BlackBerry Model的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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