admin管理员组

文章数量:1404922

After trying fingerprinting that requires that the visitor use a web browser with JavaScript enabled, I thought that I would try using browscap... browscap.ini and browscap.dll are available on all Windows computer/servers at either C:\Windows\SysWOW64\inetsrv or C:\Windows\System32\inetsrv

But I have yet to see a working example. Perhaps browscap is no longer supported or that modern web browsers are preventing it from getting a result.

As simple test to see if it was indeed being initialised, I tried using the following code on a test page:

<%@ 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>") 
%>

While this code does report that the dll was initialised, there is no result. Of course browsercap.ini should provide much more info and there is a "full" version available for even more info, but what is missing that will enable this simple test to produce a result?

After trying fingerprinting that requires that the visitor use a web browser with JavaScript enabled, I thought that I would try using browscap... browscap.ini and browscap.dll are available on all Windows computer/servers at either C:\Windows\SysWOW64\inetsrv or C:\Windows\System32\inetsrv

But I have yet to see a working example. Perhaps browscap is no longer supported or that modern web browsers are preventing it from getting a result.

As simple test to see if it was indeed being initialised, I tried using the following code on a test page:

<%@ 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>") 
%>

While this code does report that the dll was initialised, there is no result. Of course browsercap.ini should provide much more info and there is a "full" version available for even more info, but what is missing that will enable this simple test to produce a result?

Share Improve this question asked Mar 9 at 4:12 WilliamKWilliamK 7982 gold badges14 silver badges32 bronze badges 9
  • 1 Make sure the latest version of browscap.ini exists inC:\Windows\System32\inetsrv or C:\Windows\SysWOW64\inetsrv . Do you receive empty result or unknown? – Ali Sheikhpour Commented Mar 9 at 4:36
  • For Platform I got unknown and for browser I got Default – WilliamK Commented Mar 9 at 5:04
  • Aha! I updated to the latest browscap.ini and now get a result. I tried for more comprehensive report and was able to get browser version, but "unknown" for Frame support, table support, sound support, etc. To get more result, do I need to use the "full" version of browscap.ini? – WilliamK Commented Mar 9 at 5:08
  • When you receive unknown means the logic is working but for more details yes you will need full version. try this one browscap./stream?q=Full_PHP_BrowsCapINI – Ali Sheikhpour Commented Mar 9 at 9:09
  • 1 Depends on the version you download. You need to check the documentation form the download source – Ali Sheikhpour Commented Mar 11 at 12:05
 |  Show 4 more comments

1 Answer 1

Reset to default 1

If you are receiving unknown or default as the output, It means your codes are working well but you are using an old limited version of broswecap.ini . By replacing a full version of browsecap.ini in C:\Windows\System32\inetsrv and C:\Windows\SysWOW64\inetsrv , you can access more detailed information. To view all available properties use this code:

<%
On Error Resume Next

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

Dim props, prop, val
props = Array("Browser", "Version", "MajorVer", "MinorVer", "Platform", _
              "Frames", "Tables", "Cookies", "JavaScript", "VBScript", _
              "JavaApplets", "ActiveXControls", "CDF", "isMobile", "Device_Type", "Crawler")

For Each prop In props
    val = Eval("browserdetect." & prop)
    If Err.Number <> 0 Then
        Response.Write prop & " = [Not available]<br>"
        Err.Clear
    Else
        Response.Write prop & " = " & val & "<br>"
    End If
Next

Set browserdetect = Nothing
%>

Footnote after receiving comment about CDF: In different versions, some properties may not be supported which is skipped in my code. CDF is reported as "False" (not [Not available]) in the default version of broscap.ini windows 10.

本文标签: How to use browscapdll on Windows Server running IIS and Classic ASPStack Overflow