2

除了我的 asp.net 应用程序中的错误报告外,我还在检索浏览器信息。例如,我经常遇到特定错误:

Type = Mozilla
Name = Mozilla
Version = 5.0
Major Version = 5
Minor Version = 0
Platform = Unknown
Is Beta = False
Is Crawler = False
Is AOL = False
Is Win16 = False
Is Win32 = False
Supports Frames = False
Supports Tables = False
Supports Cookies = False
Supports VBScript = False
Supports JavaScript = False
0.0
Supports Java Applets = False
Supports ActiveX Controls = False

我的第一个想法是 firefox,但我也遇到了 firefox 的特定错误,所以我不确定以上信息中的确切浏览器是什么?

谢谢

4

2 回答 2

5
TRY BELOW

Response.Write(Request.ServerVariables("HTTP_USER_AGENT")) 

// 获取访问者的浏览器名称

if (Request.ServerVariables["HTTP_USER_AGENT"].Contains("MSIE"))
  browser = "Internet Explorer";
if (Request.ServerVariables["HTTP_USER_AGENT"].Contains("FireFox"))
  browser = "Fire Fox";
if (Request.ServerVariables["HTTP_USER_AGENT"].Contains("Opera"))
  browser = "Opera";
于 2011-07-01T15:09:57.120 回答
0

试试这个,它会为你提供你需要的关于你的浏览器的数据: System.Web.HttpBrowserCapabilities browser = Request.Browser;

于 2015-02-02T09:38:33.387 回答