【问题标题】:MSWC.BrowserType on IIS 8.5 always returns "Unknown" as Platform and "Default" as BrowserIIS 8.5 上的 MSWC.BrowserType 始终将“未知”作为平台返回,将“默认”作为浏览器返回
【发布时间】:2017-07-18 01:53:24
【问题描述】:

我们最近将旧的 Classic ASP 网站移至运行 IIS 8.5 的较新的 Windows Server 2012。本次切换后,MSWC.BrowserType 无法再获取用户的浏览器或平台。

在测试页面上,我有以下代码:

<%@ Language=VBScript %>
<%Option Explicit%>

<%
    Dim browserdetect

    Set browserdetect = Server.CreateObject("MSWC.BrowserType")

    if isObject(browserdetect) then
       response.write("The object was created!<br>")
    else
       response.write("The object was not created")
    end if

    Response.Write("Platform = " & browserdetect.Platform & "<br>")
    Response.Write("Browser = " & browserdetect.Browser & "<br>") 
%>

这会返回:

The object was created!
Platform = unknown
Browser = Default

我在服务器上的c:\Windows\System32\inetsrv 中确实有最新的browscap.ini。我需要做任何其他事情才能让它工作吗?

【问题讨论】:

  • 在 IIS 论坛上查看此主题 - forums.iis.net/t/1148429.aspx
  • 确保将文件放入C:\Windows\SysWOW64\inetsrv。如果运行您的应用的应用程序池是 32 位的,则会在此目录中搜索 browscap.ini

标签: asp-classic iis-8 browscap


【解决方案1】:

正如 Kul-Tigin 在上面的评论中指出的那样,如果运行您的应用程序的应用程序池是 32 位(在我的情况下是)browscap.ini 将在 C:\Windows\SysWOW64\inetsrv 中搜索。

我之前已经将browscap.ini复制到C:\Windows\System32\inetsrv,就像我一直在旧服务器上所做的那样。

【讨论】:

    猜你喜欢
    • 2023-03-25
    • 1970-01-01
    • 2012-06-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-15
    • 2014-11-10
    • 1970-01-01
    相关资源
    最近更新 更多