Detecting Internet Explorer bitness on the server side
I want to deliver an ActiveX object with the correct bitness for the requesting browser, meaning a 32-bit object for a 32-bit IE an开发者_JS百科d a 64-bit object for a 64-bit IE. For this purpose I'm looking for some criterion, as good as reasonably possible, to distinguish between the two IE architectures.
In order to make the decision on the server side, I should use the User-Agent request header, so the problem comes down to this: given the User-Agent string, how to detect, with common JSP mechanisms including just plain Java, the bitness of the IE instance which submitted the request?
So far I found that 64-bit instances include the strings "Win64" and "x64" in the header, and 32-bit instances do not. If all versions and configurations of IE follow this behavior, the solution in a JSP is as easy as
<% boolean _64 = request.getHeader("User-Agent").contains("Win64") %>
I would really like to find out if this behavior is an official IE specification, so I could count on it for all versions and configurations of IE from IE7 and to IE9. Did Microsoft publish any such specification?
Note: I'm not tagging "Java" since the answer will most likely be relevant for other languages.
See this post on the IE Blog, as well as this guide on MSDN.
To summarize, WOW64;
= 32bit IE on 64bit Windows. Win64; x64;
= 64bit IE on a 64bit OS. But note that other things, such as Windows NT 5.2
indicate (possibly) a 64bit OS.
Checkout MicroSoft msdn url for detailed description. http://msdn.microsoft.com/en-us/library/ms537503%28v=vs.85%29.aspx
Also IE8 UserAgent issues: http://blogs.msdn.com/b/ie/archive/2008/02/21/the-internet-explorer-8-user-agent-string.aspx
精彩评论