1

我正在尝试使用 51Degrees.mobi Foundation 库检测 Ipad 或三星 Galaxy Tab 或任何其他选项卡。

我正在使用 Request.Browser["is_tablet"] 但它返回错误。有没有人知道这是已知问题还是我犯了一些错误。

我正在使用 Opera Mobile Emulator 进行测试


你能给我下载iPad模拟器的网址吗?

我在下面再次描述我的问题-

我在我的 MVC 应用程序中使用 51Degrees.mobi Foundation。当我在我的视图引擎中使用 Request.Browser["is_tablet"] 来检查请求是否来自选项卡时,它给了我错误的结果。三星 Galaxy Tab(Opera 移动模拟器)和 Ipad(AIRiPad 模拟器)正在发生这种情况。

在这种情况下,Request.Browser.IsMobileDevice 和 Request.Browser["is_wireless_device"] 也返回 false。因此,为桌面设计的常规 MVC 视图正在加载。我没有在配置文件中使用位置,因为当请求来自移动设备或平板电脑时,我需要从我的视图引擎重定向到适当的视图。

让我知道 is_tablet 是否有任何已知问题,或者我做错了方式还是模拟器有问题?

4

2 回答 2

1

If you are using the open source lite device data, then you won't be able to detect the tablet capability. You can however detect both whether the device is mobile (IsMobile (boolean)) and the screen size (ScreenPixelsHeight (int) and ScreenPixelsWidth (int)). You may be able to determine whether or not the device is a tablet by using a combination of these values.

You can check the avaliable properties using the property dictionary here. Hope this helps.

于 2012-09-18T09:07:24.050 回答
0

Request.Browser["is_tablet"] 对我来说很好用:

使用 Blackbaud 实验室的 iPad 模拟器。
http://labs.blackbaud.com/NetCommunity/article?artid=662

用户代理:

Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10

检查您的日志文件 App_Data/Log.txt 是否有此条目:

信息 - 在 2295 毫秒内使用 12720 个字符串加载了 14691 个设备

在配置文件中设置要调试的日志级别
< log logFile="~/App_Data/Log.txt" logLevel="Debug"/>

于 2011-09-16T11:13:06.003 回答