Request.Browser.Platform不返回的iPad,OSX,或者Windows 7 [英] Request.Browser.Platform not returning iPad, OSX, or Windows7

查看:657
本文介绍了Request.Browser.Platform不返回的iPad,OSX,或者Windows 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一些先进的浏览器检测,而我已经下载了 MDBF 浏览器从$ C $文件CPLEX。

I'm working on some advanced browser detection, and I've downloaded the MDBF browser file from CodePlex.

不幸的是我的Request.Browser.Platform,与一些其他的东西一起被返回未知两个我的iPad的Mac OSX(雪豹)和Windows7的

Unfortunately my Request.Browser.Platform, along with a few other things is returning "Unknown" on both my iPad Mac OSX (Snow Leopard) and on Windows7

有谁知道一个良好的先进.browser文件在那里,确实对非移动设备的MDBF确实为移动设备?同样的事情

Does anyone know of a good advanced .browser file out there that does the same thing for non mobile devices as the MDBF does for mobile devices?

推荐答案

我已经解决我的具体问题(检测新iPad)在我的应用程序的 App_Browsers文件文件夹下的文件

I've solved my particular issue (detecting iPad) with the following file in my application's App_Browsers folder:

<browsers>
  <!-- Mozilla/5.0 (iPad; U; CPU OS 4_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C134 Safari/6533.18.5 -->
  <gateway id="IPad" parentID="Safari">
    <identification>
      <userAgent match="iPad" />
    </identification>

    <capabilities>
      <capability name="mobileDeviceModel"               value="IPad" />
      <capability name="mobileDeviceManufacturer"        value="Apple" />
      <capability name="isMobileDevice"                  value="true" />
    </capabilities>
  </gateway>
</browsers>

然后在code我的测试:

Then in the code I test:

if (Request.Browser.MobileDeviceModel == "IPad")
  ...

这篇关于Request.Browser.Platform不返回的iPad,OSX,或者Windows 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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