agent strings to different sites

I'm trying to track down a bug right now with a silverlight application. We are getting the browser info from the HtmlPage.BrowserInformation class, but it seems to be returning incorrect information. When running on IE9, the browser information says that it is running on version 8.0. I opened up Fiddler to see what was happening at the HTTP level, and here is what I'm getting for the user-agent strings to my test servers (the test servers run our own server software that uses WCF for HTTP requests):

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)

Here's the user-agent string when I go to any other site:

User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)

I'm not sure how the BrowserInformation class works (ie, does all of its information come from the user-agent string, or from somewhere else). Any insights on this would be helpful.


From your question it is clear that you are not a IE user.

Tho resolve your issue you need to add this to all the pages:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

It is important to add it right after the head tag like this:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
链接地址: http://www.djcxy.com/p/51892.html

上一篇: 如何以编程方式获得ie10的REAL用户代理

下一篇: 代理字符串到不同的网站