开发者

Detecting a browser type

开发者 https://www.devze.com 2023-03-16 14:48 出处:网络
Together with error reporti开发者_JS百科ng in my asp.net app, I am also retreiving browser information. For example I am getting specific error a lot:

Together with error reporti开发者_JS百科ng in my asp.net app, I am also retreiving browser information. For example I am getting specific error a lot:

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

My first idea was firefox, but I also get firefox in specific errors, so I am not sure what exact browser is from the information above?

Thanks


TRY BELOW

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

// Getting Browser Name of Visitor

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";


Try out this, it will get you the data you need about your browser: System.Web.HttpBrowserCapabilities browser = Request.Browser;

0

精彩评论

暂无评论...
验证码 换一张
取 消