asp.net获取客户端浏览器信息不准
发布网友
发布时间:2022-05-10 03:54
我来回答
共1个回答
热心网友
时间:2022-04-27 12:22
protected BowserType UserBowserType
{
get
{
string b = Request.Browser.Browser;
b = string.IsNullOrEmpty(b) ? "other" : b;
switch (b.ToUpper())
{
case "IE": return BowserType.IE;
case "FIREFOX": return BowserType.FIREFOX;
case "APPLEMAC-SAFARI": if (Request.UserAgent.IndexOf("Chrome") > 0)
return BowserType.CHROME;
else
return BowserType.OTHER;
default: return BowserType.OTHER;
}
}
}