我搜索了这个主题,并通过三种不同的方式来配置浏览器功能:browscap.ini,web.config中的browserCaps元素和App_Browsers中的.browser文件。我以为.browser文件是最新的方法,但我似乎找不到最新的文件。但是我从
http://browsers.garykeith.com/downloads.asp发现相当新鲜的browscap.ini。
我的首要任务是将普通抓取工具从访问者统计信息中排除。第二个优先事项是使用正确的版本检测浏览器和操作系统(例如Opera 11 / Win7)。
有没有可以使用的图书馆? browscap.ini仍然是一种有效的方式,是否可以使用它而无法访问系统文件?在哪里可以找到最新的.browser文件?
解决方法
更多信息:
http://msdn.microsoft.com/en-us/library/3yekbd5b.aspx
你检查过这个:
你检查过这个:
System.Web.HttpBrowserCapabilities browser = Request.Browser; string s = "Browser Capabilities\n" + "Type = " + browser.Type + "\n" + "Name = " + browser.Browser + "\n" + "Version = " + browser.Version + "\n" + "Major Version = " + browser.MajorVersion + "\n" + "Minor Version = " + browser.MinorVersion + "\n" + "Platform = " + browser.Platform + "\n" + "Is Beta = " + browser.Beta + "\n" + "Is Crawler = " + browser.Crawler + "\n" + "Is AOL = " + browser.AOL + "\n" + "Is Win16 = " + browser.Win16 + "\n" + "Is Win32 = " + browser.Win32 + "\n" + "Supports Frames = " + browser.Frames + "\n" + "Supports Tables = " + browser.Tables + "\n" + "Supports Cookies = " + browser.Cookies + "\n" + "Supports VBScript = " + browser.VBScript + "\n" + "Supports JavaScript = " + browser.EcmaScriptVersion.ToString() + "\n" + "Supports Java Applets = " + browser.JavaApplets + "\n" + "Supports ActiveX Controls = " + browser.ActiveXControls + "\n" + "Supports JavaScript Version = " + browser["JavaScriptVersion"] + "\n"; TextBox1.Text = s;