public static int getBrowser()
{
string BrowserInfo = HttpContext.Current.Request.UserAgent;
if (BrowserInfo.Contains("MSIE 7.0"))
{//IE7
return 1;
}
else if (BrowserInfo.Contains("MSIE 6.0"))
{//IE6
return 2;
}
else if (BrowserInfo.Contains("Firefox"))
{//IE6
return 3;
}
else if (BrowserInfo.Contains("Chrome"))
{//谷歌
return 4;
}
return 5;
}
详细出处参考:http://www.jb51.net/article/21713.htm
{
string BrowserInfo = HttpContext.Current.Request.UserAgent;
if (BrowserInfo.Contains("MSIE 7.0"))
{//IE7
return 1;
}
else if (BrowserInfo.Contains("MSIE 6.0"))
{//IE6
return 2;
}
else if (BrowserInfo.Contains("Firefox"))
{//IE6
return 3;
}
else if (BrowserInfo.Contains("Chrome"))
{//谷歌
return 4;
}
return 5;
}
详细出处参考:http://www.jb51.net/article/21713.htm